NC23: Internal server error after PHP 7.3 -> 7.4 upgrade

Greetings,

I’ve faced a problem after upgrade to NC 23 and getting a notification to upgrade PHP to 7.4 from my current 7.3.
After I installed 7.4 and switched it with:

sudo a2dismod php7.3
sudo a2enmod php7.4
sudo systemctl restart apache2

I’ve got nextcloud Internal server error. :slightly_frowning_face:
Switching back to 7.3 gets NC back online.

The host system is Ubuntu 20.04 witrh latest updates.
PHP version: PHP 7.4.26 (cli) (built: Nov 22 2021 09:48:15) ( NTS )
MySQL: Ver 8.0.27-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)

7.4 modules installed:

[PHP Modules]
apc
apcu
calendar
Core
ctype
date
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
igbinary
json
libxml
openssl
pcntl
pcre
PDO
Phar
posix
readline
redis
Reflection
session
shmop
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

Apache2 log error

[Tue Nov 30 19:29:18.269651 2021] [php7:error] [pid 86163] [client 84.253.112.66:52050] PHP Fatal error: Uncaught Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/html/nextcloud/lib/private/DB/Connection.php:87\nStack trace:\n#0 /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1519): OC\DB\Connection->connect()\n#1 /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1041): Doctrine\DBAL\Connection->getWrappedConnection()\n#2 /var/www/html/nextcloud/lib/private/DB/Connection.php(236): Doctrine\DBAL\Connection->executeQuery()\n#3 /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery()\n#4 /var/www/html/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()\n#5 /var/www/html/nextcloud/lib/private/AppConfig.php(344): OC\DB\QueryBuilder\QueryBuilder->execute()\n#6 /var/www/html/nextcloud/lib/private/AppConfig.php(109): OC\AppConfig->loadConfigValues()\n#7 /var/www/html/nextcloud/lib/private/AppConfig.php(300): in /var/www/html/nextcloud/lib/private/DB/Connection.php on line 87

Please help to find an issue.

Update: it looks like, PHP misses the driver to access MySQL. I have php-mysql installed, however neither php7.3-mysql nor php7.4-mysql. Tried to install php7.4-mysql, this didn’t work but the Apache2 log has changed:

Log with php7.4-mysql

[Tue Nov 30 20:01:05.338682 2021] [mpm_prefork:notice] [pid 106185] AH00170: caught SIGWINCH, shutting down gracefully
[Tue Nov 30 20:01:05.436976 2021] [mpm_prefork:notice] [pid 109867] AH00163: Apache/2.4.51 (Ubuntu) OpenSSL/1.1.1f mod_wsgi/4.6.8 Python/2.7 configured – resuming normal operations
[Tue Nov 30 20:01:05.437021 2021] [core:notice] [pid 109867] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Nov 30 20:01:06.116062 2021] [proxy:error] [pid 109876] [client 84.253.112.66:52529] AH10221: proxy: websocket: client flushing failed (-102)

From this point I don’t know what to do.

Nevemind, it turned out I was missing certain a couple PHP modules for 7.4.
For those with similar problem, see the list of required modules in official docs: https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation