Cron.php fails with "Class 'PDO' not found in /.../DriverManager.php on line 195"

Nextcloud version: 17.0.1
Operating system and version: Centos 7
Apache or nginx version: 2.4.6
PHP version : 7.2.24

The issue you are facing:
Last background job execution ran 2 days ago. Something seems wrong

Is this the first time you’ve seen this error? : Y

Steps to replicate it:
I don’t know :stuck_out_tongue:

The output of your Nextcloud log in Admin > Logging:
https://pastebin.com/6LY9zU3k

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):
https://pastebin.com/CPDBBmdE

The output of your Apache/nginx/system log in /var/log/____:
https://pastebin.com/aA8Xpxsq

Hey there,
I’ve installed nextcloud on a VPS recently and liked a lot so far. I used it mainly for file and RSS feed syncing, but the latter has recently stopped working. The cronjob for nextcloud doesn’t run anymore and when I manually run
# sudo -u apache php -f /var/www/subdomain.domain.tld/html/cron.php I get the following error:
PHP Fatal error: Class 'PDO' not found in /var/www/subdomain.domain.tld/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php on line 195
I’ve tried looking around, but haven’t found anything useful. I started to notice the issue a day after I tried setting up a pi-hole and invidious instance (Neither of which worked so I uninstalled both again). I don’t know if that could be related, but any help would be appreciated. The logs I attached are cut to only contain very recent messages, but I can include more information if that’s needed.

Aunt G. recommends e.g. to read the following threads:


Hmm I swear I tried that.
sudo -u apache /opt/rh/rh-php72/root/usr/bin/php -f /var/www/subdomain.domainn.tld/html/cron.php runs without issues, but running sudo -u apache php --version returns 7.2 so I don’t know why pointing directly to the new version would make a difference. I changed the crontab entry to */5 * * * * /opt/rh/rh-php72/root/usr/bin/php -f /var/www/subdomain.domain.tld/html/cron.php but it’s kinda strange that it worked with just php before. I’ll see if this works tomrrow

1 Like