PHP Change 7.3 to 8.2 / Upgrade failed

I want to upgrade in PHP from Version: 7.3.33 to 8.2, but unfortunately I get this error message with this command:

root@nextcloudpi:/home/pi# a2enmod php8.2

Considering dependency mpm_prefork for php8.2:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php8.2:
Module php8.2 already enabled

In the Nextcloud administration it says that I still have PHP version 7.3.33.

I do not get the problem solved.

I would be very pleased to receive support!

It would certainly be very easy to help you with some more informations.

Then you should not skip the support template and provide the informations about your system.
Is it a containerized (e.g. docker) instance?

There are two different ways your apache2 server can communicate with php:

  1. Module (libapache2-mod-php8.2) which requires the mpm_prefork module

  2. Fast Process Manager (php8.2-fpm) which in turn requires the mpm_event proxy_fcgi and setenvif modules.

mpm_prefork and mpm_event are mutually exclusive.

Here some enable/disable commands (as functions) you should know in this context:

# $1 version
php_a2module_enable() {
    a2enmod mpm_prefork php$1

# $1 version
php_a2module_disable() {
    a2dismod php${1:-*} mpm_prefork

# $1 version
php_fpm_enable() {
    a2enmod mpm_event proxy_fcgi setenvif
    a2enconf php$1-fpm

# $1 version
php_fpm_disable() {
    a2disconf php${1:-*}-fpm
    a2dismod mpm_event

Keep in mind to always first didsable the old php before enabling the new one.

I hope this helps,
much luck!

1 Like

Thank you very much for your quick reply.

I have integrated a Raspberry Pi + hard drive into my home network.
Everything is working as far as it goes. I would like to upgrade to the new PHP.

Unfortunately, I still do not manage, am not yet so experienced in this subject.
Which commands do I have to execute exactly? You wrote that there was a conflict.

If you realy want help with “exact commands” than please don’t leave my questions without exact answers.

How should one help you when you don’t provide the information from within the support template and without the information if your nextcloud is running in a container (like docker or nextcloud-pi)?

1 Like

It is a nextcloud-pi.

Through various commands, a more recent PHP version could be updated. I then had a hint to increase the nextcloud version, I did.
(As an aside, the software on the pi were from 2020, so very out of date, wasn’t using the time).
Anyway, it’s up and running right now. Now there are some notes in the “Security & Setup Warnings” that I should change. Let’s see if I can get it to work.

I now have the following versions:
NextCloud 26.0.7
PHP: 8.2.10

Are the versions OK so far or still too outdated?

“The PHP memory limit is below the recommended value of 512MB.”

I have adjusted the php.ini (memory_limit = 512M) and with
“systemctl restart apache2” reloaded. I still get this notice in the dashboard. What could be the reason for this?

both set: memory_limit = 512M
nano /etc/php/8.2/apache2/php.ini
nano /etc/php/8.2/fpm/php.ini