Nextcloud 27.0.1 and php 8.2.8

Hi, I am using NC 27.0.1 and updated to PHP 8.2.8 (what NC System says), but when I check php -i grep php.ini PHP Version => 8.0.29 is enabled on my system Ubuntu 20.04.6 LTS. I still have an PHP Memory_Limit issue which is below 128M. I modified all php.ini in 8.0 and 8.2 (apache2/fpm) and even in 8.1 but issue remains the same. What is wrong with my configuration?
Thanks in advance for your support!

In short: it is a mess!

If you want to use e.g. php8.2 then you should either remove all php7.4, php8.0 and php8.1 from your system or use update-alternatives to set version 8.2 for all php related packages to manual 8.2. This is the command:

for linkgroup in `ls /var/lib/dpkg/alternatives/ | grep -E "ph(ar|p)"`; do sudo update-alternatives --config $linkgroup; done

Then you can connect php to your web server with either php-fpm ( /etc/php$version/fpm/…) or libapache2-mod-php ( /etc/php$version/apache2/…) but not both together. So you should decide:

  • php-fpm is the “Fast Process Manager” and supports http2 while
  • libapache2-mod-php is an apache module and is a bit easier to administrate

and clean up there too.

then you should not install php(-<module>) but php8.2(-<module>) instead.

Here are a few more commands to examine or cleanup your system:

list all installed php related packages on your system:

dpkg -l | awk '/^ii.*php/ {print $2}'

list the used php sapi by apache2:

apachectl -tD DUMP_INCLUDES | sed -n '/php.*conf/ s#.*/\([^/]*\)\.conf#\1#p'

Remove unwanted php-Versions:

for version in 7.4 8.0 8.1; do sudo apt-get remove --purge *php${version}*; done

There are plenty of posts here on this forum about exactly the same issue.

Hope that helps,
much luck!