Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database

I’m running Nextcloud on a Virtualmin environment (on Ubuntu 16.04) from a few months without any problems.

Last system upgrade cause Nextcloud to stop working: cannot access with clients (internal server error), unable to load web interface. This are the errors logs:

mod_fcgid: stderr: PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /home/myuser/domains/app.mydomain.it/public_html/nextcloud/lib/private/DB/Connection.php:60
mod_fcgid: stderr: Stack trace:
mod_fcgid: stderr: #0 /home/myuser/domains/app.mydomain.it/public_html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()
mod_fcgid: stderr: #1 /home/myuser/domains/app.mydomain.it/public_html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()
mod_fcgid: stderr: #2 /home/myuser/domains/app.mydomain.it/public_html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()
mod_fcgid: stderr: #3 /home/myuser/domains/app.mydomain.it/public_html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(621): Doctrine\\DBAL\\Connection->getDatabasePlatform()
mod_fcgid: stderr: #4 /home/myuser/domains/app.mydomain.it/public_html/nextcloud/lib/private/D in /home/myuser/domains/app.mydomain.it/public_html/nextcloud/lib/private/DB/Connection.php on line 60

So I update Nextcloud (without problems) to the last stable version 11.0.1, but this doesn’t solve the problem.

Some ideas?


Following Nextcloud installation instructions I checked the installation of all packages and I found that php7.0-mysql was missing (don’t ask me why…).

1 Like

Still same problems, 4 years and nothing is fixet. I dont get it, peoples storing data here, and we have 100 bugs every time. They developing code wiithout testing or what.

Had the same problem. At the end, I had made an “apt autoremove” and all of my php7.4 plugins were gone!
Going through the apt history log I could find out the list of removed modules, reinstalled all, retarted apache2 service and problem was solved!