Troubles after ugrading to Debian Stretch / MariaDB

Hi all,
I’ve just noticed some troubles that arose after upgrading the OS from Debian Jessie to Stretch. During this upgrade MySQL was replaced by MariaDB.

Although Nextcloud is running without any (obvious) issues, I found in the “Admin” tab the error message “Last job execution ran 3 days ago. Something seems wrong.” -> cron.php has not been executed by cron.

Manually executing the script did not update the message.

Manually executing the following command produced pages of error messges:

root@caldav:~# sudo -u www-data php /var/www/owncloud/occ user:lastseen barbara
An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /var/www/owncloud/lib/private/DB/Connection.php:61

Can anybody give me a hint on solving this issue?

Thanks a lot,
Slimhering

The error seems to say that the php MySQL driver is not installed.

The upgrade from jessie to stretch also changes the default PHP version from 5.6 to 7.0. Please check with dpkg -l php* which versions of PHP you have installed. If there are multiple, look at ls -al /etc/alternatives/php* to see which ones are the default.

Then you should make sure that:

  • the database driver is installed for the PHP version you use. If you now use php7, then the package php7.0-mysql is needed.

  • the webserver and cron job use the same PHP version

Hi M4lvin,
thanks for the very useful hint! Indeed, there are two versions of PHP installed:

root@caldav:~# ls -al /etc/alternatives/php*
lrwxrwxrwx 1 root root 15 Jan  5 21:16 /etc/alternatives/php -> /usr/bin/php7.0
lrwxrwxrwx 1 root root 31 Jan  5 21:16 /etc/alternatives/php.1.gz -> /usr/share/man/man1/php7.0.1.gz
lrwxrwxrwx 1 root root 17 Dez  6  2015 /etc/alternatives/php-cgi -> /usr/bin/php5-cgi
lrwxrwxrwx 1 root root 33 Dez  6  2015 /etc/alternatives/php-cgi.1.gz -> /usr/share/man/man1/php5-cgi.1.gz
lrwxrwxrwx 1 root root 21 Dez  6  2015 /etc/alternatives/php-cgi-bin -> /usr/lib/cgi-bin/php5

This explains, why my NextCloud is running flawlesly… (beside the cron.php)

I will try to sort out my version-diversity :wink:
Morst likely I will come back with some further questions.

In the meantime: Thanks again for your valuable support!!!
Cheers,
Slimhering

Hi all,
to warm up my previous thread: Now my server in using two different versions: The cron job was updated to php7.0 whereas the apache continues to use 5.

Can anybody help me on how to upgrade the version used by apache also?

Shall I use ‘update-alternatives’? Or is the PHP version set in an apache config file?

Thanks for your support!
Slimhering

Both. You should run update-alternatives and depending on your apache config file (both global and virtual hosts) you might have to change other settings. It also depends on whether you use the apache-php module, cgi, fcgi or php-fpm. There are many ways to make apache and php talk to each other :wink:

Besides that, if you do not need the old PHP for anything else, I would suggest you just uninstall all php5 packages.