Can't upgrade 8.0php-fpm to 8.2-fpm

After upgrade to Nextcloud Hub 6 (27.1.9) I need to upgrade from PHP 8.0 to 8.2 which I have done:
“php -v” → PHP 8.2.18 (cli) (built: Apr 11 2024 20:37:35) (NTS)
I followed the instructions in Upgrade PHP 8.0 to 8.2.
However, I can’t seem to sort the php-fpm upgrade.
“a2enmod php8.2” produces the following:
Considering dependency mpm_prefork for php8.2:
Considering conflict mpm_event for mpm_prefork:
ERROR: Module mpm_event is enabled - cannot proceed due to conflicts. It needs to be disabled first!
Considering conflict mpm_worker for mpm_prefork:
ERROR: Could not enable dependency mpm_prefork for php8.2, aborting.

Nextcloud version (eg, 20.0.5): 27.1.9
Operating system and version (eg, Ubuntu 20.04): 22.04
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.59 (Ubuntu)
PHP version (eg, 7.4): 8.2.18

The issue you are facing:
Can’t resolve conflict between mpm_event and mpm_prefork

Is this the first time you’ve seen this error? (Y):

Steps to replicate it:

  1. Upgrade PHP 8.0 to 8.2
  2. Attempt to load 8.2php-fpm
  3. Error as above

Packages Loaded:

libapache2-mod-php8.0/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
libapache2-mod-php8.2/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php-common/jammy,now 2:94+ubuntu22.04.1+deb.sury.org+2 all [installed,automatic]
php-imagick/jammy,now 3.7.0-4+ubuntu22.04.1+deb.sury.org+2 amd64 [installed]
php8.0-apcu/jammy,now 5.1.23-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-bcmath/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-bz2/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-cli/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.0-common/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-curl/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-fpm/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-gd/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-gmp/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-igbinary/jammy,now 3.2.15-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-imagick/jammy,now 3.7.0-4+ubuntu22.04.1+deb.sury.org+2 amd64 [installed]
php8.0-intl/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-mbstring/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-mysql/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-opcache/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-readline/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.0-redis/jammy,now 6.0.2-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-xml/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0-zip/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.0/jammy,now 1:8.0.30-5+ubuntu22.04.1+deb.sury.org+1 all [installed]
php8.1-common/jammy,now 8.1.28-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.1-readline/jammy,now 8.1.28-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.2-apcu/jammy,now 5.1.23-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-bcmath/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-bz2/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-cli/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-common/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-curl/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-fpm/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-gd/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-gmp/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-igbinary/jammy,now 3.2.15-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-imagick/jammy,now 3.7.0-4+ubuntu22.04.1+deb.sury.org+2 amd64 [installed]
php8.2-intl/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-mbstring/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-mysql/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-opcache/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-phpdbg/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.2-readline/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-redis/jammy,now 6.0.2-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-xml/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-zip/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2/jammy,now 8.2.18-1+ubuntu22.04.1+deb.sury.org+1 all [installed]
php8.3-cli/jammy,now 8.3.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.3-common/jammy,now 8.3.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.3-imagick/jammy,now 3.7.0-4+ubuntu22.04.1+deb.sury.org+2 amd64 [installed,automatic]
php8.3-opcache/jammy,now 8.3.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.3-phpdbg/jammy,now 8.3.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.3-readline/jammy,now 8.3.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]

If I did read the guides properly, you first will need to do an
“a2dismod php8.0”

In your description above you tried to load the PHP 8.2 modules additional to PHP 8.0

1 Like

Thanks very much. I did wonder about that after I made the post. I’ll try again.

I’m getting:
xxx:/etc/apache2$ sudo a2dismod php8.0
Module php8.0 already disabled
xxx:/etc/apache2$ sudo a2dismod php8.2
Module php8.2 already disabled

I think I am right in saying that php8.x can’t be loaded with fpm. So that seemed like the solution but the above suggests not. Sorry, I find php configuration very confusing.
PS: I also get:
xxx:~$ sudo a2enmod php8.2-fpm
ERROR: Module php8.2-fpm does not exist!

Check, whether a php 8 process still ist running.
ps xa|grep php

I today had a similar issue after upgrading from php 7.4 to 8.1. There was an instruction in the apache config file, which still created a php 7.4 socket in /run/php.
Maybe in your apache config file (/etc/apache2/sites-enabled/*.conf there is a similar setting calling php 8.0.

That is the command to enable the apache2handler (libapache2-mod-php)

The php-fpm is another SAPI, which is mutually exclusive with apache2handler.

You should understand how php functions and completely remove (purge) the libapache2-mod-php* packages if you want to use the php-fpm SAPI

Run the php-updater script and read its help for more details.


Much and good luck,
ernolf

Ah yes. I’m getting:

2036 ? Ss 0:04 php-fpm: master process (/etc/php/8.2/fpm/php-fpm.conf)
2037 ? S 0:00 php-fpm: pool www
2038 ? S 0:00 php-fpm: pool www
2370 ? Ss 0:04 php-fpm: master process (/etc/php/8.0/fpm/php-fpm.conf)
3012 ? S 2:49 php-fpm: pool www
3041 ? S 2:46 php-fpm: pool www
14541 ? S 0:17 php-fpm: pool www
14936 pts/0 S+ 0:00 grep --color=auto php

I changed:
Include /etc/apache2/conf-available/php8.0-fpm.conf
to
Include /etc/apache2/conf-available/php8.2-fpm.conf

and all seems OK.
I’ll continue to test and many, many thanks