Trying to add missing columns, error could not connect DB

Besides that NC is telling me to update PHP, it also tells me that:

i have to run occ db:add-missing-columns

So i am trying to do that:

cd /var/www/nextcloud
sudo -u www-data php occ db:add-missing-columns

But than i get the error:
An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: couldn’t find driver in /var/www/nextcloud/lib/private/DB/Connection.php:67

and some more simliar errors.

Does anybody know how to fix this?

Check your php-cli configuration and make sure that the required php database module is loaded.

I am pretty new to this, so i am not sure what to do exactly. I should check php.ini ? And how do i know what the required database module is?

You should know which database (SQLite3, MySQL/MariaDB, etc.) you’ve used to set-up Nextcloud. It might help to check the dbtype-parameter in the Nextcloud configuration file. Additionally the database should already have been configured for the php-web component. Maybe it’s only a copy job to get the right configuration file for the php-cli component. Keep in mind to install and use the correct module for the used php version :wink: