Nextcloud25 upgrade php7.4 to php8.1

[/details]

Nextcloud version __: 25.0.2
Operating system and version __: Debian 10
Apache or nginx version __: Apache 2.4.38
PHP version (eg, 7.4): 8.1

The issue you are facing:
I upgraded Nextcloud from 24 to 25, and now it tells me that php7.4 is no longer supported and I need to upgrade to php8.1

Steps to replicate it:
I installed php 8.1 -
apt install php8.1 php8.1-gd php8.1-mysql php8.1-curl php8.1-mbstring php8.1-intl php8.1-gmp php8.1-bcmath php-imagick php8.1-xml php8.1-zip libapache2-mod-php8.1 php8.1-memcached

php -v
PHP 8.1.13 (cli) (built: Nov 26 2022 14:29:42) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies
with Zend OPcache v8.1.13, Copyright (c), by Zend Technologies

a2dismod php7.4
a2enmod php8.1
a2disconf php7.4-fpm
a2enconf php8.1-fpm

/etc/init.d/apache2 restart

But, then I get a blank page when I try to connect to nextcloud.

Also, when I try to run occ commands I get -
#/usr/bin/sudo -u www-data php /var/www/html/nextcloud/occ files:scan --all
PHP Warning: PHP Startup: Unable to load dynamic library ‘mysqli’ (tried: /usr/lib/php/20210902/mysqli (/usr/lib/php/20210902/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20210902/mysqli.so (/usr/lib/php/20210902/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘pdo_mysql’ (tried: /usr/lib/php/20210902/pdo_mysql (/usr/lib/php/20210902/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib/php/20210902/pdo_mysql.so (/usr/lib/php/20210902/pdo_mysql.so: undefined symbol: pdo_parse_params)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘pdo_mysql.so’ (tried: /usr/lib/php/20210902/pdo_mysql.so (/usr/lib/php/20210902/pdo_mysql.so: undefined symbol: pdo_parse_params), /usr/lib/php/20210902/pdo_mysql.so.so (/usr/lib/php/20210902/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘pdo_pgsql.so’ (tried: /usr/lib/php/20210902/pdo_pgsql.so (/usr/lib/php/20210902/pdo_pgsql.so: undefined symbol: pdo_parse_params), /usr/lib/php/20210902/pdo_pgsql.so.so (/usr/lib/php/20210902/pdo_pgsql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
An unhandled exception has been thrown:
Error: Class “PDO” not found in /var/www/html/nextcloud/lib/private/DB/Connection.php:155
Stack trace:
#0 /var/www/html/nextcloud/lib/private/AppConfig.php(412): OC\DB\Connection->getQueryBuilder()
#1 /var/www/html/nextcloud/lib/private/AppConfig.php(180): OC\AppConfig->loadConfigValues()
#2 /var/www/html/nextcloud/lib/private/AppConfig.php(371): OC\AppConfig->getApps()
#3 /var/www/html/nextcloud/lib/private/legacy/OC_App.php(965): OC\AppConfig->getValues()
#4 /var/www/html/nextcloud/lib/private/Server.php(725): OC_App::getAppVersions()
#5 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC{closure}()
#6 /var/www/html/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#7 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#8 /var/www/html/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#9 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#10 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(184): OC\AppFramework\Utility\SimpleContainer->get()
#11 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#12 /var/www/html/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#13 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#14 /var/www/html/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#15 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#16 /var/www/html/nextcloud/lib/private/Server.php(1119): OC\AppFramework\Utility\SimpleContainer->get()
#17 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC{closure}()
#18 /var/www/html/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#19 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#20 /var/www/html/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#21 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#22 /var/www/html/nextcloud/lib/private/Server.php(2070): OC\AppFramework\Utility\SimpleContainer->get()
#23 /var/www/html/nextcloud/lib/private/Files/View.php(117): OC\Server->getLockingProvider()
#24 /var/www/html/nextcloud/lib/private/Server.php(462): OC\Files\View->__construct()
#25 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC{closure}()
#26 /var/www/html/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#27 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#28 /var/www/html/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#29 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#30 /var/www/html/nextcloud/lib/private/Server.php(1472): OC\AppFramework\Utility\SimpleContainer->get()
#31 /var/www/html/nextcloud/lib/base.php(617): OC\Server->boot()
#32 /var/www/html/nextcloud/lib/base.php(1144): OC::init()
#33 /var/www/html/nextcloud/console.php(48): require_once(‘…’)
#34 /var/www/html/nextcloud/occ(11): require_once(‘…’)
#35 {main}

When I check,
/usr/lib/php/20210902/mysqli.so
/usr/lib/php/20210902/pdo_mysql.so

these exist.

But,

/usr/lib/php/20210902/pdo_mysql.so.so
/usr/lib/php/20210902/pdo_pgsql.so.so

Those are not there.

I’m at a loss as to where the issue lies.