I have NextcloudPi running on Rock64 (Pi like) under Armbian BullsEye.
Iām running NC V25.0.3.
NCP 1.52.0 enable update to V26.
At the end of update, there is an abort because of PHP 7.4.33. Need to update PHP8.0.
But when I do the PHP8.0 update (with Sury package source), my NC server goes down.
In the System Info of NCP web, NextCLoud check : error ; HPB service : down. All other are green.
And NCP, when asking to update to last NextCloud, tells me the server is down and doesnāt do the updateā¦
For the server to be up, I have to go back to PHP7.4, so no NC upgradeā¦
Do you have any logfiles you can check why its not working/no access possible?
Check the NC logs and your webserver logs. Maybe you see anything interesting there.
When installing PHP8.0 (āphp -vā gives me āPHP 8.0 is runningā), āphp8.0-fpmā is not installed so PHP is using php7.4-fpm.
NextCloud Admin Overview tells me Iām using php 7.4.33 and I should update.
Nextcloud works with this setting, I can acces my datas, but for NextCloudPi, I have āNextcloud checkā and āHPB serviceā error (so no NC26 update possible).
If I try to install āphp8.0-fpmā and enable it āa2enconf php8.0-fpmā then I got āInternal sever Errorā when trying to load my NC webpage.
I think my problem is with the fpm thing.
Regarding the logs, where should I look ?
Too much āPermission deniedā when trying to access /var/www/nextcloud ot /var/log/apache2ā¦
I have written a script for a safe php upgrade on debian like systems:
go back to your 7.4
remove all NOT-7.4 packages and all so caled ādependency-packagesā and āmeta-packagesā:
The automatic update from one to the next version is done by so called ādependency-packagesā like āphp ā and other packages with names like php-{module} (without the version String) Those packages can almost all safely be removed, what will give you back the control over your php-version. When you try to deinstall a package, you will see if it is a dependency for one or more php7.4-* modules (like php-common which is allways needed). All other packages that donāt meet any dependencies can and should be removed.
A package as āphp7.4 ā is a so caled āmeta-packageā and can be removed too.
execute the script simply by calling it: sudo php-updater
it looks what php-version actually is installed and asks which new version you want to install. (First I would recommend 8.0). After the installation it migrates all settings from your old php-installation (php.ini for php-cli and php-apache2 or - in case you are using php-fpm - the php.ini for php-fpm and pool.d/www.conf for php-fpm) into the new version.
If you already have installed one or more new versions (e.g. 8.0 and 8.1), you can use the script for only the later step (the migration from all setting) by calling it sudo php-updater 7.4 8.0
In this case, it takes the settings from your 7.4 Version and helps you to integrate them into the 8.0 version.
Run this command to control, if all php-versions are switched to the version you want. I would recommend to not leave it in automatic mode but choosing the respective manual mode so that no unintentional version changes can take place, but only after your conscious change (using this command):
(updated: addedsudo, see #8):
for linkgroup in $(ls /var/lib/dpkg/alternatives/ | grep -E "ph(ar|p)"); do sudo update-alternatives --config $linkgroup; done
finaly change the used php-version in your apache server (updated: added libapache2-mod-php):
Thanks for the help
I tried to compare php.ini from 7.4 and 8.0 to see if there was some settings differences but too long file ^^ā
At step 5, at the ends of the questions, I got some permission denied for writing settings, for exemple at the full end (I selected ā2ā, 8.0 manual mode, for all the questions) :
"There are 2 choices for the alternative php (providing /usr/bin/php).
Press to keep the current choice[], or type selection number: 2* update-alternatives: error: unable to create file ā/var/lib/dpkg/alternatives/php.dpkg-tmpā: Permission denied update-alternatives: warning: alternative /run/php/php8.0-fpm.sock (part of link group php-fpm.sock) doesnāt exist; removing from list of alternatives update-alternatives: warning: /etc/alternatives/php-fpm.sock is dangling; it will be updated with best choice There is only one alternative in link group php-fpm.sock (providing /run/php/php-fpm.sock): /run/php/php8.0-fpm.sock Nothing to configure. update-alternatives: error: unable to create file ā/var/lib/dpkg/alternatives/php-fpm.sock.dpkg-tmpā: Permission denied"
/var/lib/dpkg/alternative/ path is root:root ownedā¦
I created a dummy āphp.dpkg-tmpā file with pi:pi owner so the command could modity the file but then got some permission denied for moving āphp.dpkg-tmpā to āphpā.
What should I do to enable/fix this ?
I know and I used it.
I tried to compare before reading your post as I thought it was a config problem.
I think the things I tried today before you posted your help messed up my setting.
Tomorrow morning Iāll restore my backup image to use your script on a working install.
I want to tone down your hopes a bit as Iām not an expert on NCPi.
My advice more or less assumed php-fpm was used, you mentioned that somewhere, but that doesnāt seem to be the case.
However, the update script only updates those packages that are already installed. So if libapache2-mod-php7.4 was installed and you selected 8.0 as the new version, then it will also install libapache2-mod-php8.0 and not php8.0-fpm unless php7.4-fpm was already present before (which doesnāt seem to be the case).
Nevertheless, the script cannot do any harm and makes it much easier to take over the php.ini settings (thatās what I originally wrote it for).
In my previous posts, I explained how to switch php version when using php-fpm or how to activate it.
Please note: the steps to switch php-version from 7.4 to 8.0 with libapache2-mod-php are:
I thought you script would install PHP8.0.
So I did it and ran your script.
Everything went flowless.
But at the end when changing the used fpm from 7.4 to 8.0 (a2enconfā¦), I got āInternal server Errorā on my server webpage.
I think Iāll go for my plan B : backup my setup, use a new NextCloudPi image with NextCloud 26 installed (with PHP8.0) and then restore.
My original image is from 2019. At some point, fresh install is better.
I was almost hit by first Murphyās rule : Never try to fix something working !
I made a backup and export my NCP setting.
I wrote a new NCP image (1.52 + NC26 and PHP8).
I restored my backup and import my settings. (logically went back to NC25 but with PHP8.0)
=> the path to my datas was not restored, my Letās encrypt was not working (couldnāt write registered adress file).
As I only have one MicroSD card I have to joggle between images.
At the end, I restored my NC25/PHP7.4 image and got my setup working again.
Think Iāll wait for Armbian update (this summe as other Debian distro) to have PHP8.0 properly installed and then update to NC26.