How to switch to 8.2 by default

Thank you very much for your help
the sudo command was used to lace the script, but unfortunately the result is not positive, I have the error:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

here is the result of the script
I confirmed yes to all the questions

pi@home:~ $ sudo chmod +x /usr/local/bin/php-updater
pi@home:~ $ sudo php-updater 7.3 8.2

Do you want to migrate the values from the config file(s) for "php-cli"
from version 7.3 into the corresponding php.ini for version 8.2? (Y/n) y

Setting "%H:%M:%S"" not found in /etc/php/8.2/cli/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "%H:%M:%S" = %H:%M:%S"" appended to the end of /etc/php/8.2/cli/php.ini

The value for "html_errors" is not set
Do you want to set "html_errors" with the old value "On"? (Y/n) y
Setting "html_errors = On" added after line 561 in /etc/php/8.2/cli/php.ini

Setting "ibase.allow_persistent" not found in /etc/php/8.2/cli/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.allow_persistent = 1" appended to the end of /etc/php/8.2/cli/php.ini

Setting "ibase.dateformat" not found in /etc/php/8.2/cli/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.dateformat = "%Y-%m-%d"" appended to the end of /etc/php/8.2/cli/php.ini

Setting "ibase.max_links" not found in /etc/php/8.2/cli/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.max_links = -1" appended to the end of /etc/php/8.2/cli/php.ini

Setting "ibase.max_persistent" not found in /etc/php/8.2/cli/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.max_persistent = -1" appended to the end of /etc/php/8.2/cli/php.ini

Setting "ibase.timeformat" not found in /etc/php/8.2/cli/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.timeformat = "%H:%M:%S"" appended to the end of /etc/php/8.2/cli/php.ini

Setting "ibase.timestampformat" not found in /etc/php/8.2/cli/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.timestampformat = "%Y-%m-%d" appended to the end of /etc/php/8.2/cli/php.ini

Setting "log_errors_max_len" not found in /etc/php/8.2/cli/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "log_errors_max_len = 1024" appended to the end of /etc/php/8.2/cli/php.ini

Setting "uploadtmp_dir" not found in /etc/php/8.2/cli/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "uploadtmp_dir = /media/myCloudDrive/ncdata/tmp" appended to the end of /etc/php/8.2/cli/php.ini

Do you want to migrate the values from the config file(s) for "php-fpm"
from version 7.3 into the corresponding php.ini for version 8.2? (Y/n) y

The value for "disable_functions" differs: new value ""
Do you want to set "disable_functions" to the old value "pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,"? (Y/n) y
Changed disable_functions from "" to "pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,"

Setting "%H:%M:%S"" not found in /etc/php/8.2/fpm/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "%H:%M:%S" = %H:%M:%S"" appended to the end of /etc/php/8.2/fpm/php.ini

The value for "html_errors" is not set
Do you want to set "html_errors" with the old value "On"? (Y/n) y
Setting "html_errors = On" added after line 562 in /etc/php/8.2/fpm/php.ini

Setting "ibase.allow_persistent" not found in /etc/php/8.2/fpm/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.allow_persistent = 1" appended to the end of /etc/php/8.2/fpm/php.ini

Setting "ibase.dateformat" not found in /etc/php/8.2/fpm/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.dateformat = "%Y-%m-%d"" appended to the end of /etc/php/8.2/fpm/php.ini

Setting "ibase.max_links" not found in /etc/php/8.2/fpm/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.max_links = -1" appended to the end of /etc/php/8.2/fpm/php.ini

Setting "ibase.max_persistent" not found in /etc/php/8.2/fpm/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.max_persistent = -1" appended to the end of /etc/php/8.2/fpm/php.ini

Setting "ibase.timeformat" not found in /etc/php/8.2/fpm/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.timeformat = "%H:%M:%S"" appended to the end of /etc/php/8.2/fpm/php.ini

Setting "ibase.timestampformat" not found in /etc/php/8.2/fpm/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "ibase.timestampformat = "%Y-%m-%d" appended to the end of /etc/php/8.2/fpm/php.ini

Setting "log_errors_max_len" not found in /etc/php/8.2/fpm/php.ini
Do you want to append it to the end of the file? (Y/n) y
Setting "log_errors_max_len = 1024" appended to the end of /etc/php/8.2/fpm/php.ini

The value for "sys_temp_dir" is not set
Do you want to set "sys_temp_dir" with the old value "/media/myCloudDrive/ncdata/tmp"? (Y/n) y
Setting "sys_temp_dir = /media/myCloudDrive/ncdata/tmp" added after line 776 in /etc/php/8.2/fpm/php.ini

The value for "upload_tmp_dir" is not set
Do you want to set "upload_tmp_dir" with the old value "/media/myCloudDrive/ncdata/tmp"? (Y/n) y
Setting "upload_tmp_dir = /media/myCloudDrive/ncdata/tmp" added after line 854 in /etc/php/8.2/fpm/php.ini

Do you want to migrate the values from the config file "pool.d/www.conf" for "fpm"
from version 7.3 into the corresponding "pool.d/www.conf" for version 8.2? (Y/n) y

The value for "pm" differs: new value "dynamic"
Do you want to set "pm" to the old value "static"? (Y/n) y
Changed pm from "dynamic" to "static"

The value for "pm.max_children" differs: new value "5"
Do you want to set "pm.max_children" to the old value "39"? (Y/n) y
Changed pm.max_children from "5" to "39"

The value for "pm.start_servers" differs: new value "2"
Do you want to set "pm.start_servers" to the old value "4"? (Y/n) y
Changed pm.start_servers from "2" to "4"

The value for "pm.min_spare_servers" differs: new value "1"
Do you want to set "pm.min_spare_servers" to the old value "4"? (Y/n) y
Changed pm.min_spare_servers from "1" to "4"

The value for "pm.max_spare_servers" differs: new value "3"
Do you want to set "pm.max_spare_servers" to the old value "8"? (Y/n) y
Changed pm.max_spare_servers from "3" to "8"

The value for "pm.max_children" is not set
Do you want to set "pm.max_children" with the old value "39"? (Y/n) y
Setting "pm.max_children = 39" added after line 111 in /etc/php/8.2/fpm/pool.d/www.conf

The value for "pm.max_spare_servers" is not set
Do you want to set "pm.max_spare_servers" with the old value "8"? (Y/n) y
Setting "pm.max_spare_servers = 8" added after line 103 in /etc/php/8.2/fpm/pool.d/www.conf

The value for "pm.min_spare_servers" is not set
Do you want to set "pm.min_spare_servers" with the old value "4"? (Y/n) y
Setting "pm.min_spare_servers = 4" added after line 99 in /etc/php/8.2/fpm/pool.d/www.conf

The value for "pm.start_servers" is not set
Do you want to set "pm.start_servers" with the old value "4"? (Y/n) y
Setting "pm.start_servers = 4" added after line 98 in /etc/php/8.2/fpm/pool.d/www.conf

The value for "pm.status_path" is not set
Do you want to set "pm.status_path" with the old value "/status"? (Y/n) y
Setting "pm.status_path = /status" added after line 267 in /etc/php/8.2/fpm/pool.d/www.conf

The value for "slowlog" is not set
Do you want to set "slowlog" with the old value "log/$pool.log.slow"? (Y/n) y
Setting "slowlog = log/$pool.log.slow" added after line 385 in /etc/php/8.2/fpm/pool.d/www.conf
pi@home:~ $ for linkgroup in `ls /var/lib/dpkg/alternatives/ | grep -E "ph(ar|p)"`; do sudo update-alternatives --config $linkgroup; done
Il existe 2 choix pour l'alternative phar (qui fournit /usr/bin/phar).

  Sélection   Chemin            Priorité  État
------------------------------------------------------------
* 0            /usr/bin/phar8.2   82        mode automatique
  1            /usr/bin/phar7.3   73        mode manuel
  2            /usr/bin/phar8.2   82        mode manuel

Appuyez sur <Entrée> pour conserver la valeur par défaut[*] ou choisissez le numéro sélectionné :
Il existe 2 choix pour l'alternative phar.phar (qui fournit /usr/bin/phar.phar).

  Sélection   Chemin                 Priorité  État
------------------------------------------------------------
* 0            /usr/bin/phar.phar8.2   82        mode automatique
  1            /usr/bin/phar.phar7.3   73        mode manuel
  2            /usr/bin/phar.phar8.2   82        mode manuel

Appuyez sur <Entrée> pour conserver la valeur par défaut[*] ou choisissez le numéro sélectionné :
Il existe 2 choix pour l'alternative php (qui fournit /usr/bin/php).

  Sélection   Chemin           Priorité  État
------------------------------------------------------------
* 0            /usr/bin/php8.2   82        mode automatique
  1            /usr/bin/php7.3   73        mode manuel
  2            /usr/bin/php8.2   82        mode manuel

Appuyez sur <Entrée> pour conserver la valeur par défaut[*] ou choisissez le numéro sélectionné :
Il n'existe qu'une « alternative » dans le groupe de liens phpdbg (qui fournit /usr/bin/phpdbg) : /usr/bin/phpdbg8.2
Rien à configurer.
Il existe 2 choix pour l'alternative php-fpm.sock (qui fournit /run/php/php-fpm.sock).

  Sélection   Chemin                    Priorité  État
------------------------------------------------------------
* 0            /run/php/php8.2-fpm.sock   82        mode automatique
  1            /run/php/php7.3-fpm.sock   73        mode manuel
  2            /run/php/php8.2-fpm.sock   82        mode manuel

Appuyez sur <Entrée> pour conserver la valeur par défaut[*] ou choisissez le numéro sélectionné :
pi@home:~ $

That may be, because you may not yet have done this step:

You did not provide any information about the webserver you are using, so I am unable to help you with that step.

much luck!

Could you please tell me how I can give you the information. Normally I use the server that nextcloudpi has configured by default.

No, I can not do that. I’m not familiar with Nextcloud PI at all. I’ve already said that.

But there are many here in the forum who know exactly what to do and would like to help you further.

According to GitHub - nextcloud/nextcloudpi: 📦 Build code for NextcloudPi: Raspberry Pi, Odroid, Rock64, Docker, curl installer...

it is served by apache2.

On a debian Server this is what you have to do:

sudo a2disconf php7.3-fpm
sudo a2enconf php8.2-fpm
sudo systemctl restart apache2 php8.2-fpm

But again, I am no nextcloudpi expert!

much luck!

I’ll try to find out more and then post a message here

thank you very much, it’s an apache2 server.
I’ve applied the commands, but I still have a problem
when I go to nextcloud, I get the error:

This version of Nextcloud is not compatible with > PHP 8.0.
You are currently running 8.2.8.

when I try to update nextcloud, I get the following error:

Running nc-update-nextcloud
/usr/local/etc/library.sh: ligne 470 : [:  : nombre entier attendu comme expression
PHP:  syntax error, unexpected '"' in /etc/php/8.2/cli/php.ini on line 1979
Nextcloud is currently down
Done. Press any key...

I’ll see if I can find a solution

Unfortunately I haven’t found a solution.
Does anyone know where to look?

Then is this what you could do:

Look back all the steps you did to enable php8.2 and repeat it now for php8.0:

Install exactly the packages and sapi versions for version 8.0 that you have now installed for version 7.3:

for package in $(echo `dpkg -l | awk '/^ii.*php7.3/ {print $2}' | sed 's/php7.3/php8.0/g'`); do sudo apt-get -y install $package;  done

migrate all settings from 7.3 to 8.0.

sudo php-updater 7.3 8.0

Switch all php-Packages with the update-alternative mechanism to use “manual 8.0”:

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

And finaly you do:

sudo a2disconf php8.2-fpm
sudo a2enconf php8.0-fpm
sudo systemctl restart apache2 php8.2-fpm

Much luck!

Thank you for being so patient with me.
Unfortunately, I always get the error

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

and when updating

Running nc-update-nextcloud
PHP:  syntax error, unexpected '"' in /etc/php/8.0/cli/php.ini on line 1948
Nextcloud is currently down
Done. Press any key...

it looks like I’m doomed to remain in php 7.3

Looks like you are still on Debian 10.
This looks like you didn’t update your OS a long time.

You can enter post here the output of the command “ncp-report”. This should show all necessary log files.

If you have a up to date ncp system you should be in Debian 11 with php 8.1

1 Like

Thank you REAPERSbattlecry for taking an interest in my problem.
I put the code in an attached text file because the report contains too many characters.
ncp-rapport.odt (13,4 Ko)

What version of raspberry pi do you use?

To be honest. I’ll recommend a new set up and installation of ncp on your raspberry.
The reason are as already mentioned you are on an old raspian / debian version.

Second and even bigger issue is that you still using a 32 bit OS. This could be an issue.
So if you are using a raspberry pi which is capable of 64 bit I would go for the big step.

1 Like

Hi, I have a raspberry pi 4, which supports 64 bit.
The problem is that I use deck for my work and I have a huge number of cards and a lot of users that I can’t lose.
I’ve already tried updating in different ways but each time I get errors that prevent me from having a functional nextcloud.


If you do a search with my username, you’ll notice that it’s not because I don’t want to update my nextcloud.
Unfortunately, every time I get stuck, no solution is found.

Then I assume you already have a proper backup and migration strategy in place, otherwise you will eventually lose data!

Ask yourself the following questions:

  • How do I back up my data in a way that I can get it back if I need to rebuild the system?

  • How can I migrate to a new system without losing data?

If you can’t answer these questions, you must definitely not host important data exclusively on this system, and certainly not any data from third parties!

I mean what are you going to do if the SD card, SSD, or device itself dies?

I make a backup without data every two days and a full backup with all the data every month.
i also have a copy of the sd card

Are you refering to this: How to backup and restore a NextCloudPi instance using ncp config ? If yes, you could use that backup to migarte your current setup, including the database, to a new installation.

  1. Create a new backup (clone) of the SD CARD!

  2. IMPORTANT: Test if the backup SD-CARD is booting, everything is working and all the data is there.

  3. Create a new full backup incl. all the data, as described in the link above.

  4. Re-install NCP on your current SD-CARD (or use a third SD-CARD to be extra safe).

  5. Restore the backup on the fresh installation

I’ve already used this method, but it doesn’t work, I get an error when restoring ncp-config_XXXXXXXX.tar

The cause for the failure could be the different raspian/Debian versions…

Does that mean I have to update debian first before doing the update procedure?

I’ve updated to debian 11, but there are still a lot of errors.
I give up…