I have an Ubuntu server 20.04 installation that among other things is running a bare-metal Nextcloud instance using Apache as the web server. I have multiple PHP versions installed, but up to this point Apache was using PHP 7.4. Since Nextcloud deprecated it, I was trying to migrate to PHP 8.1 (the new recommended version, still no support for PHP 8.2). I tried following many guides on how to do this, all of them basically boil down to installing PHP 8.1 and the needed modules, use a2dismod php7.4
to disable the old PHP version, enable the new one with a2enmod php8.1
and restart Apache with systemctl restart apache2
. This is the last one I followed: link.
But despite this, Apache keeps using PHP 7.4. If I try to uninstall PHP 7.4, my Nextcloud installation just breaks (I get a 503 error). I tried with slight variations, but always failed and ended up restoring the lvm snapshot I created before the attempt. But I still didn't restore the snapshot of the last attempt, here I did all the steps in the linked guide and I didn't uninstall PHP 7.4, so my Nextcloud is still working but using the wrong version. What can I check or try to fix this?
Thank you for your help,
GTP