PHP8.2 with Nextcloud 25.0.2

Www.google.com… lil’ joke :wink:

https://stackoverflow.com/questions/58045685/uninstall-php-7-in-ubuntu-18-04

^^^ always a good source

Greetings

Whilst Linux is growing on me, things like major upgrades of PHP still fill me with fear and uncertainty. My client is running on Centos 7 so for the record, these are the instructions to upgrade from PHP v7.x to 8.1 on a Centos 7, NGINX, MariaDB system:

Stop services systemctl stop nginx mariadb php-fpm
Install latest repository tools yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Install latest repository tools yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
Disable older versions of PHP yum-config-manager --disable ‘remi-php*’
Configure to install PHP v8.1 yum-config-manager --enable remi-php81
Install PHP yum -y install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-snmp php-mbstring php-pecl-zip php-xmlrpc libxslt php-xml php-fpm
Start services systemctl start nginx mariadb php-fpm

I ran them with sudo -i so don’t need sudo in front. Although that’s not the complete (massive) stack of PHP modules, those not listed seem to sort themselves out. Bit of “with a following wind” kind of upgrade.

I also ran into this problem but i just manually changed php version to 8.1 with this command

sudo update-alternatives --config php

after i picked php 8.1 everything was back to normal… now its just waiting time until nexcloud support 8.2

2 Likes

Thanks for this workaround.
I think I heard Nextcloud 26 should support PHP 8.2 …

Many greetings

This just ******** my config, i spend hours, en then i read this…

This.

Manually reinstall php8.1 (so that it gets flagged as manually installed) and use this and you should be fine with updates in the future.

Thanks a lot.

I am currently running php 7.4 and have a warning that says:

That page lists 8.0, 8.1, and 8.2 as currently supported. If something listed there isn’t compatible maybe additional context or actually supported versions should be listed. I luckily searched before doing the upgrade, but almost jumped straight to 8.2 which is what Nextcloud is appearing to say it supports in the warning message.

@nmbgeek
Which operating system and version do you use? It is no problem to use PHP 7.4. If you use e.g. Debian Bullseye (PHP 7.4) you can first upgrade in a few month to Debian Bookworm (PHP 8.1) and then upgrade to e.g. Nextcloud 26.

Alternatively, you can of course include a third-party source with PHP 8.0 or better PHP 8.1 and upgrade PHP for your Nextcloud already now.

I don’t do that. I’m much too lazy for that.

PHP 8.2 is not supported for Nextcloud25.

Hi. The keywords are: …as soon as your distribution supports it… Thats the point.
I ran into an automatic upgrade from php 8.1 to 8.2, which killed my webgui.
So I fixed the version to php8.1, as long as the version is not discontinued, it will stay that way. Only then I will upgrade.
I don’t know why and I wonder how I got NC 25 (as I had configured only the stable-channel-updates), but from the beginning it ran very smoothly and stable, at the moment on an old, but reliable running (and running and running…) computer. The only problem was my linux distribution, which decided to upgrade php…

So be aware for the next announcements. Afaik, NC 26 should support php8.2.

Many greetings

Well because, Nextcloud 25 was officially released as “stable”. I won’t comment on Nextcloud’s “relesae often and release early” strategy, there are already enough discussions on this topic in the forums and it’s offtopic in this thread anyways. :wink:

I run Nextcloud 25 on Debian server. I made some system administration mistakes:
I did not keep the PHP8.1 deb packages.
I failed to disable the PHP update.
Fortunately, I was able to download
PHP 8.1.14 (cli) (built: Jan 13 2023) packages
Manual installation and modification of the php config.
Everything works again.

Maybe not so useful info, but running the Nextclod VM you can’t upgrade to an unsupported version. It will stop you before it happens. :slight_smile:

The page you referring to are the PHP versions that are supported by the people who develop PHP.

That are not necessary the PHP versions that Nextcloud support. That being said, it’s sad to see that Nextcloud still doesn’t support PHP 8.2.

I understand that, but the way the message is worded in Nextcloud is as if it will support any currently supported version when it in fact does not. My point is that if Nextcloud is going to give a warning that it is time to look into PHP upgrades and link to currently supported versions (by the PHP Group) it should in fact also list the major caveat that the most recent supported version (by the PHP Group) is in fact not support by Nextcloud. Something to the tune of “Your Nextcloud instance is using PHPvX.X which is now deprecated. Nextcloud XX.X supports up to PHP vX.X. For more details see server requirements here.” would be ideal.

The Nextcloud warning is just this which isn’t very

/lib/versioncheck.php edit and remove this:

// Show warning if >= PHP 8.2 is used as Nextcloud is not compatible with >= PHP 8.2 for now
if (PHP_VERSION_ID >= 80200) {
http_response_code(500);
echo ‘This version of Nextcloud is not compatible with PHP>=8.2.
’;
echo 'You are currently running ’ . PHP_VERSION . ‘.’;
exit(1);
}

1 Like

Yeah sure, just turn off the warning and everything will be fine :wink:

Either you have issues with 8.2 or you don’t. If you do have issues you have to downgrade PHP, if you don’t have issues you can just ignore the warning, as it will disappear with Nextcloud 26 anyways…

Well, I don’t know, everything works for me even on nextcloud 24. The restriction does not make logical sense, because php 8.1 and 8.2 are not much different. I don’t have an option to install an older version of php because I use debian sid

1 Like

Hi,
I did run Nextcloud 25 and bullseye (debian 11).
And wanted to go up one release for both.

So I did upgrade my debian to bookworm (debian 12).

Debian 12 install php 8.2.7, and my nextcloud was stuck saying that it was not compatible.
Debian 12 does not enable the installation of a lower release of php.

So I did apply a patch on versioncheck.php, by changing ‘PHP_VERSION_ID >= 80200’ to ‘PHP_VERSION_ID >= 80300’ and run the upgrade for nextcloud.

It did work, and saved me from a difficult situation.
I am now running Debian 12, php 8.2 and Nextcloud 26…

Thanks.

Note for nextcloud developpers :

I would have liked for this upgrade that the Nextcloud 26 to be compatible with a common release wih Nextcloud 26 and Debian 12…

Don’t forget that Nextcloudhas to be supported by an OS/distribution.

Docker is not a true solution for configuration management, and stability.

Regads.