I m currently running NC version 22.2.3 on Ubuntu 20.04.4 LTS.
According to the “Settings > System” page, NC is using PHP7.4:
However, when I run
sudo -u www-data php /var/www/nextcloud/occ upgrade from the console it says:
This version of Nextcloud is not compatible with > PHP 8.0.<br/>You are currently running 8.1.3
php -v on the console shows:
PHP 8.1.3 (cli) (built: Feb 21 2022 14:48:42) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.3, Copyright (c) Zend Technologies
with Zend OPcache v8.1.3, Copyright (c), by Zend Technologies
However, if I try to switch php versions,
sudo a2dismod php8.1 says:
ERROR: Module php8.1 does not exist!
Any ideas on how to fix this or what I am doing wrong?
Enabling and disabling mods is for apache. On the command line, you are using php directly. If you have different versions on your system, you probably have something like
php is just a link to the most recent version.
ls -lisa /usr/bin/php*
My main issue here (and why I used the command line in the first place) is that the updater in the NC webui does NOT work.
When I click on the “Continue update” button in the updater (Settings - Overview - Open Updater), it just jumps back to the dashboard instead of actually running the update.
ls -lisa /usr/bin/php* shows this output:
2891240 0 lrwxrwxrwx 1 root root 21 Dec 28 2019 /usr/bin/php -> /etc/alternatives/php
2885520 4420 -rwxr-xr-x 1 root root 4525040 Nov 19 07:39 /usr/bin/php5.6
2885373 4428 -rwxr-xr-x 1 root root 4533256 Nov 19 07:39 /usr/bin/php7.0
2886671 4584 -rwxr-xr-x 1 root root 4694008 Nov 19 07:37 /usr/bin/php7.1
2886675 4936 -rwxr-xr-x 1 root root 5051576 Nov 19 07:36 /usr/bin/php7.2
2894571 4704 -rwxr-xr-x 1 root root 4814744 Nov 19 07:25 /usr/bin/php7.3
2884785 4684 -rwxr-xr-x 1 root root 4794296 Feb 17 17:06 /usr/bin/php7.4
2884587 4856 -rwxr-xr-x 1 root root 4970672 Feb 21 15:42 /usr/bin/php8.0
2885509 5396 -rwxr-xr-x 1 root root 5523816 Feb 21 15:48 /usr/bin/php8.1
2885770 0 lrwxrwxrwx 1 root root 24 Mar 17 02:31 /usr/bin/phpdbg -> /etc/alternatives/phpdbg
2885583 4516 -rwxr-xr-x 1 root root 4622104 Nov 19 07:39 /usr/bin/phpdbg5.6
2886568 4552 -rwxr-xr-x 1 root root 4660736 Nov 19 07:39 /usr/bin/phpdbg7.0
2886673 4716 -rwxr-xr-x 1 root root 4825600 Nov 19 07:37 /usr/bin/phpdbg7.1
2886677 5060 -rwxr-xr-x 1 root root 5179040 Nov 19 07:36 /usr/bin/phpdbg7.2
2894651 4828 -rwxr-xr-x 1 root root 4942016 Nov 19 07:25 /usr/bin/phpdbg7.3
2884613 4964 -rwxr-xr-x 1 root root 5081528 Feb 21 15:42 /usr/bin/phpdbg8.0
2885512 5456 -rwxr-xr-x 1 root root 5585424 Feb 21 15:48 /usr/bin/phpdbg8.1
How can I fix the webui updater not working?
Any ideas on this topic?
Change back to the earlier php version. Or, install it if you do not have it available and then switch.
Also, try filling out the support form offered when first posting to this support category. That will make it much easier to assist you.
Change back to the earlier php version.
That is exactly what I m trying to do.
Please let me know how that is supposed to work and I will gladly test it.
Also, I m happy to provide any relevant information required to solve the issue.
Let me know, which information / output you need (apart from the OS version, NC version, PHP verisions and the error message provided in the initial posting) and I will collect them.
Hi @sne, you can replace php by php8.0 ( this is not a long term solution) like this :
sudo -u www-data php8.0 /var/www/nextcloud/occ upgrade
maybe this topic can help you for your web updater issue: Upgrade 23.0.2 -> 23.0.3 - #22 by franz.hartwig
Thank you for the reply.
Manually using a non-default php version would be my manual workaround at the moment (will test after next weekly backup).
However, that does not seem to solve the underlying issue of the automatic updater not working, which is very very likely caused by the php issue.
I checked out the other thread, however I dont have a .step file in my “updater” folder and the other user gets further than I do.
So this seems to be an unrelated issue, but thank you for pointing that out.
Its hard for me to believe that no one ran into the php issue yet, as I am not doing anything unusual here.
Actually the only thing I do on the OS level is the monthly “apt update && apt upgrade”.
Try to switch to php8 or later.
You can do it this way …
That actually seems to have changed the PHP version.
For some reason, all the other guides out there, use a2dismod.
Unfortunately, this did not solve the issue of the updater jumping right back to the dashboard.
The logs (in the webui) show no error.
Any clue how to troubleshoot this?
I dug a bit deeper and found a folder called
This folder indeed contained a
.step as mentioned in the article from @Mageunic .
After renaming the file the updater started successfully and I was able to carry out the update using the normal occ command.
So at the moment, what I assume has happened (although I do not have proof) is that
- the updater started, created the .step file, but found a non-compatible php version and failed / stopped / crashed
- even after fixing php by manually setting it to PHP 7.4 again (the same version that is shown in the NC webui), the .step file still existed, which prevented the updater from running and kicked me back to the dashboard
- after changing PHP to a compatible version and removing / renaming the blocking .step file, the update was successful.
So thank you @Mageunic for mentioning the other article and thank you @guddl for showing a linux noob how to switch PHP versions.