Operating system and version (e.g., Ubuntu 24.04):
Ubuntu 22.04.5
Web server and version (e.g, Apache 2.4.25):
2.4.63
Reverse proxy and version _(e.g. nginx 1.27.2)
1.27.4
PHP version (e.g, 8.3):
8.1.31
Is this the first time you’ve seen this error? (Yes / No):
Yes
When did this problem seem to first start?
03/05/2025
Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
via HectiaCP
Are you using CloudfIare, mod_security, or similar? (Yes / No)
using CloudfIare
Summary of the issue you are facing:
Hello community!
I encountered a problem. When updating from php8.1 to php8.3, NextCloud Hub 9 (30.0.6) does not work. Internal server error.
I updated PHP according to the instructions. I switch using the HestiaSP control panel. At the same time, the Apache2 server works fine on php8.3. Any ideas on how to fix this?
Log entries
[Tue Mar 11 11:47:00.478674 2025] [proxy_fcgi:error] [pid 1139267:tid 1139315] [client 212.xxx.xxx.x:0] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught OCP\\HintException: [0]: Memcache OC\\Memcache\\Memcached not availabl
e for local cache (Is the matching PHP module installed and enabled?)\n\n thrown in /home/nextcloud_usr/web/nextcloud.my-domain.com/public_html/lib/private/Memcache/Factory.php on line 75'
[Tue Mar 11 11:50:30.243510 2025] [proxy_fcgi:error] [pid 1139266:tid 1139304] [client 212.xxx.xxx.x:0] AH01071: Got error 'Primary script unknown'
How did you update PHP? From a third-party source?
If so why don’t you just upgrade Ubuntu 22.04 LTS to Ubuntu 24.04 LTS like everyone else who doesn’t want to use third party sources? The Nextcloud releases are designed so that you don’t need any external PHP sources when using Ubuntu.
Maybe first deactivate memcache because of your logfile.
Whenever changing PHP versions, you must make sure all the required PHP modules are installed with the new version. See the Admin Manual for the list (https://docs.nextcloud.com)
But it could be even easier, if you had documented the hole installation process, and all the configuration changes, because then you could simply do an apt purge php*, and reinstall everything with 8.3, the same way you did, with 8.1.
And in case you copy and pasted it from some tutorial, you could purge 8.1 and reinstall it again with the same tutorial, but with a different version number in the commands, unless of course you’re initial installation was done on a much older version, in which case some things might have changed.
Oh and besides documentation, backups or VM snapshots are also helpful in situations like this
Yes, that’s a bit strange with the PHP modules. You can see if you can e.g. install php-memcache incl. dependencies instead of php8.3-memcache . Maybe the problem won’t occur next time.
If you use the packages from your own release, e.g. Ubuntu 22.04 LTS, you should not have to specify any PHP versions because the correct versions are installed. With an update from Ubuntu 22.04 LTS to Ubuntu 24.04 LTS, all packages should then update correctly.
That’s because a particular version of Ubuntu ships with a particular version of PHP, and that version never changes during the lifetime of that particular Ubuntu release.
However, if you’re installing PHP from deb.sury.org, you’ll usually want to explicitly specify a version, because otherwise you’ll get the latest version available, and more importantly, as soon as a new version becomes available in the repository, PHP will automatically be upgraded to the new version during system updates, which can be a problem if the currently installed Nextcloud version is not yet compatible.
You get everything from the currently used Ubuntu release. So you would have to switch from Ubuntu 22.04 LTS to Ubuntu 24.04 LTS.
Or you continue to use an old Ubuntu 22.04 LTS and get the foreign source newer PHP packages.
It’s a bit like Windows XP back then. An operating system that has aged for decades, where you try to install new software.
Ubuntu 24.04 LTS contains PHP 8.3 see here . You could have saved yourself the external source.
Nextcloud can be used without external PHP sources when using the correct Nextcloud release and the correct Ubuntu version.
The real question is, when do you want to upgrade from Ubuntu 22.04 LTS to Ubuntu 24.04 LTS? Of course, Ubuntu 22.04 LTS is supported for e.g. 5 (or 10, 12) years. But in the end you will not be able to avoid Ubuntu 24.04 LTS. There is no upgrade path from Ubuntu 22.04 LTS to e.g. Ubuntu 26.04 LTS. Alternatively, you can of course try to migrate your Nextcloud to a current Ubuntu after e.g. 10 years.
Thanks for the answer.
Yes, I plan to upgrade to Ubuntu 22.04 later, but I don’t know when
Also, tell me why the official Nexcloud documentation still recommends 22.04?
Unfortunately, I don’t know that either. Perhaps a mistake. Maybe it’s also intentional, because similar to Nextcloud, Ubuntu doesn’t want you to switch on the day of release. A change period of one year is still normal for Ubuntu LTS, for example, and has not yet been reached.
In the end, it also makes a difference whether you run Nextcloud privately with a few users or in a corporate environment with thousands of users. Unfortunately, the site does not differentiate.
The recommendation for Ubuntu 22.04 LTS is also still at Nextcloud 31 (Hub 10). I think it could be customised. Especially as PHP 8.3 is supplied directly with Ubuntu 24.04 LTS.
No, that’s perfectly fine, as long as you know how the repo behaves, i.e. what happens if you install the packages with or without an explicit version number, and what to do when upgrading to a new Ubuntu release. But as already mentioned, you can always just remove PHP completely and reinstall it with the same settings, so either way using an external repo won’t cause any unsolvable issue after all.
The main advantage of using the sury repo is that you can manage the PHP version independently of the Ubuntu release, meaning you can upgrade to a newer PHP version without having to upgrade the OS which of course would have further implications than just PHP, or you can upgrade to a PHP version that Ubuntu doesn’t offer at all yet, which will be usefull probably with Nextcloud 32 or 33, when they might list PHP 8.4 as the recommended version, but Ubuntu 26.04 isn’t out yet.
Long story short. Both approaches (Ubuntu packages or external repo) are valid aproches, but if you always want to use the latest Nextcloud version with the recommended version of PHP, you might get into situations where you will only be able to do so by using the external repo.