Internal Server Error after PHP Upgrade

I have installed all the extensions. I activated some of them in

/etc/php/8.1/apache2/php.ini

and in

/etc/php/8.1/cli/php.ini

by uncommenting the lines but not for all the modules there were lines with extension=modulename. Do I have to activate all the others by adding lines to my php.ini files?

As for mysql I uncommented pdo_mysql and mysqli. Does Nextcloud use them both?