[Solved] Post-4.0/Buster upgrade PHP7.0+Nextcloud error

Template below…

Problem description: even after upgrade to 4.0/Buster, some PHP 7.0 packages are installed and apparently in use. Nextcloud seems to run fine, however giving:

sudo -u nextcloud php /var/www/nextcloud/occ maintenance:mode --on

Results in:

This version of Nextcloud requires at least PHP 7.2
You are currently running 7.0.33-30+0~20200807.37+debian10~1.gbp047872. Please update your PHP version.

So although Nextcloud itself appears to work, maintenance mode doesn’t, which is a problem for me. Is it safe to uninstall all PHP 7.0 packages? Will that solve the problem?

My YunoHost server

Hardware: Odroid-HC
YunoHost version: 4.0.4
I have access to my server : Through SSH, and through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : No

That’s because the php command still defaults to php7.0

A simple fix should be to explicitly run php7.3 :

sudo -u nextcloud php7.3 /var/www/nextcloud/occ maintenance:mode --on

Is there any reason to keep PHP7.0?

The box only has Yunohost with Nextcloud and Grafana. Was 7.0 kept only because Debian doesn’t delete it out of concern for unknown uses for it?


Yes and no, it’s complicated … as long as some package depends on it, apt/dpkg will keep php7.0 and related packages installed. I suspect that this is probably nextcloud-ynh-deps, a virtual package created by app, that still depends on it because it’s not migrated automatically… You could try to force the upgrade of both apps and may it would go away

But it’s not that much of a big deal to still have php7.0 installed

Did a little sleuthing. Not all of php7.0 was remaining, but some of the common stuff was. I switch cli to 7.3 using:

sudo update-alternatives --set php /usr/bin/php7.3

Everything worked. So I decided to try removing 7.0 using:

sudo apt purge php7.0 php7.0-common

That appears to have worked. Restarted the server for good measure and so far so good. Now Nextcloud cli (eg maintenance mode) works.

Thank you for your help!


This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.