Maintaining proper PHP versions of Nextcloud in Ubuntu

I’m a little bit referring to Stop making new versions (which was closed but someone pointed to this thread).

My problem with the “version spam” of Nextcloud is that I’m an Ubuntu LTS user. And the support of PHP versions is very narrow. E.g. I wanted to update from a version which supported 7.4 to another one which supportet 8.2-8.4 (something like that). Ubuntu itself was still supporting 7.4.

I said to myself: “just go to the newest version if you have to install ondrej/php anyway”. But No! I had to update to a version in between frist. That version supported neither 7.4 nor 8.4 but only 8.0-3! Nextcloud is an absoulte nightmare for Ubuntu LTS user. And this is not a niche distribution.

End of rant.

Not really. Most Nextcloud versions support at least two, sometimes even three different PHP versions. And at least the PHP version in the latest Ubuntu LTS is always supported by Nextcloud. Currently this is Ubuntu 22.04 with PHP 8.1.

Well, is it really too much to ask to take a quick look at the system requirements before upgrading your software?

No it’s not, ok maybe if you want to make use the full 5 year (or 10 year) LTS support, without adding any third party repos. But in your case, since you’re using the Sury repos anyways, it would only have been necessary to read system requirements for the software you are running. :wink:

And yes, if you are running a manual installation of Nextcloud, you are responsible for managing the dependencies yourself. If you don’t want to do this, I recommend using Nextcloud AIO, which will take care of everything for you.


I’m moving these replies to a new topic on maintaining Nextcloud PHP versions in Ubuntu.

Sounds like the PHP repository method for moving to the latest build is not so different from Nextcloud’s release cycle.

Reads to me as PHP maintenance is the issue. I looked it up and you can install and specify which version of PHP you want to use, so you will need to add a couple extra steps to define which PHP you wish Ubuntu to install from the repo, as opposed to letting it choose the latest. :heart:

1 Like

Most Nextcloud versions support at least two, sometimes even three different PHP versions.

Ubuntu 20.04 is supported until 2025 and comes with PHP 8.0. I would have no problems im NC 30+ (or whatever is current 2025) would still support 8.0. And yes you agree with me. 2-3 versions is very narrow - at least compared to all other PHP software I’m using with Ubuntu LTS.

Well, is it really too much to ask to take a quick look at the system requirements before upgrading your software?

Well, is it really too much to ask to support a wider range of PHP versions like all the other developers are competent to do?

Why is it required to make a middle PHP step? When I’m on 7.4 and want to end on 8.3. I have to install the whole PHP stack (mbstring, curl, mysql…) of 8.0 during the NC update? I can’t upgrade the old because my PHP is too old, but using the newest PHP doesn’t work because my PHP is too new.

And when I install PHP imagemagik from Sury it’s never recognised by NC.

Yet another thread where someone wants to blow off some steam about a mishap that happened to them.

This and similar topics have been discussed here a thousand times, and no, it’s not going to happen. If you want to use products with slow development on outdated technology, you can use OwnCloud. They are basically still on the same 2016 tech stack from which Nextcloud was forked from, and as we have seen recently, they also carried security vulnerabilities from 2016 to 2023, that have already been fixed in Nextcloud 10 :wink:

So, that was a little rant from me. Don’t take it personally.

1 Like

Hmm, this and the PHP question are readily solvable. Which is good. Example, NextcloudPi uses both of these exactly as you describe. So, you can definitely sort it out with a little research.

This is an Ubuntu issue as opposed to Nextcloud. Good news is the ability to select your php version will be the same used by anyone on Ubuntu or Debian.

Ok, it’s my fault that NC doesn’t take care of common and still supported Linux distros. I understood that.

It’s nobody’s fault. It’s just the way it is.

The PHP version in the latest Ubuntu LTS is supported, which means you have to update your OS every two years, or if you want to stay on an older version of Ubuntu you can install a specific PHP version from the Sury repos. I think that’s reasonable.

I mean, where would you draw the line? Ubuntu (with extended maintenance) is supported for 10 years. Should Nextcloud continue to support 10 year old PHP versions?

1 Like

:heart: quote=“user0185, post:8, topic:175750”]
NC doesn’t take care of common and still supported Linux distros

No, we are saying Ubuntu and Debian require you to manually select which php version to install from the repo. Otherwise Ubuntu will install latest.

It is agnostic from Nextcloud. Since the issue is with Ubuntu you can consult their documentation for how to select the required php version from sury’s repo.

Hopefully better documentation can be available for people stuck on this step, but finding a fix does pop up immediately on stackoverflow or Google. :heart:

Dear @user0185 ,

I feel with you and that is the reason I wrote the php-updater script with builtin and -changelog of the most php-ini directives and a verbose explanation (which you should read first):

sudo wget -O /usr/local/bin/php-updater
sudo chmod +x /usr/local/bin/php-updater
php-updater -h

It is permanently updated, so it will become more functions, defaults and informations in future.

The change between php-versions does not have to be more as just a couple of klicks/commands. (Ubuntu 22.4 LTS)

But please stop blaming the world for your dificulties, it doesn’t make it easier! :wink:

Much luck,

1 Like

@ernolf @just

As I said before: I understood that it’s my and Ubuntu’s fault that NC is the only PHP software that doesn’t support all the PHP versions Ubuntu keeps secure via apt. All other softwares are bad by supporting Ubuntu 20 LTS PHP security updates until 2025. How dare they?

That is a wrong assumption. You can easily brick your system with apt. Above all, apt can completely mess up a php installation with its dependency- and meta-packages.

Without a deeper understanding of the package structure of php and its extensions, an update or even a simple apt-get dist-upgrade almost always goes wrong.

Read this:


It is not a “fault”, it is a deliberate decision. If you don’t like it, open a feature request on Github or use something else, but for God’s sake, stop responding like a stubborn child to people who are trying to help you.


You can try the clear suggestions to select a specific PHP version. The instructions are readily available if you wish to follow them.

All users of Debian and Ubuntu must use Sury’s repo to run Nextcloud, which could one day include yourself. You could also switch to NextcloudPi, which also uses Sury’s repo. Or another pre-built system which will sort this out for you like the Snap release.

Your questions have been clearly answered. Good luck.

1 Like