This version of Nextcloud is not compatible with > PHP 7.4.<br/>You are currently running 8.0.1

Hello,

I need help please, my cron is broken since NC 20

When I launch : php -f /var/www/nextcloud/cron.php

I obtained : This version of Nextcloud is not compatible with > PHP 7.4.
You are currently running 8.0.1

My nextcloud is up to date : 20.0.6

How can I fix this error ?!

Thanks you very much

1 Like

How can I fix this error ?!

by using PHP 7.4 instead of PHP 8.

Ok so how can I downgrade my PHP version ?

I would need a liitle more information about your system, especially about the OS you’re running nextcloud on.

depends on your installation: os and web server?

I running on Ubuntu Server 18.04.5 LTS and Nginx 1.18.0

If you don’t tell us, witch system you’re running, you can’t get an working answer…

Perhaps you du a websearch?

https://www.google.com/search?q=downgrade+php

First Do a complete backup!

Than try this way, but beware it’s for apache not for nginx…

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.4
sudo apt-get install php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-mysql php7.4-mbstring php7.4-zip php7.4-fpm php7.4-intl php7.4-simplexml
sudo a2dismod php7.4
sudo a2enmod php7.4
sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php7.4
sudo update-alternatives --set phar /usr/bin/phar7.4
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4
sudo update-alternatives --set phpize /usr/bin/phpize7.4
sudo update-alternatives --set php-config /usr/bin/php-config7.4

??? he is running nginx.

as i wrote…

sudo apt remove php*

sudo apt install php7.4-gd php7.4-mysql php7.4-curl php7.4-mbstring php7.4-intl php7.4-gmp php7.4-bcmath php-imagick php7.4-xml php7.4-zip

These are the recommended packages from the nextcloud docs. Of course it depends on your sepcific installation what packages you have installed exactly. Do you have notes how you installed your Nextcloud the first time?

Important: Do not use “apt purge”! Because that deletes also the configuartion files. If you use apt remove php* only the packages will be removed and any changes in the configuration do not have to be made again after the downgrade, because the old configuration files will still be there.

2 Likes

@maouu and check your nginx config (most likely in /etc/nginx/conf.d/) if you use a unix socker with the php version on the path

upstream php-handler {
    # server 127.0.0.1:9000;
    server unix:/var/run/php/php7.4-fpm.sock;
}
1 Like

…and one more thing: If you do not have any notes, here a little hint that may help:

dpkg --get-selections | grep php will show you all PHP-Packages that are installed on your system. Copy the output of this to a texteditor before you uninstall everything :wink:

1 Like

Thanks a lot everybody! I’ll downgrade my PHP

This happens every time, again and again and again :-\

This time around though there is no fix in sight:

There are no plans to add support for PHP 8 to Nextcloud 20.

1 Like

@ckujau

On Arch you can install older PHP versions from the AUR. PHP - ArchWiki

Beside of that a rolling release distro like Arch is maybe not the best choice to run server applications like nextcloud. At least if you don’t want to deal with regular changes to your system and their effects on the installed applications. :wink:

Minor releases should not have such major changes that risk to break certain thing. In case of problems many people would complain about that. If you care about php8, you can join the developers and testers and alert everybody and test much earlier, so when NC 20 was still in development.

For anyone with the same problem – in most cases, you will still have php7.4 on your machines, even if php8 gets installed (e.g. through sury). You do not need to uninstall php8, you can just specify that Nextcloud should use php7.4.

For example:
sudo -u www-data php7.4 /var/www/nextcloud/occ maintenance:mode --off
sudo -u www-data php7.4 /var/www/nextcloud/occ maintenance:mode --on

For cron to work:

crontab -u www-data -e

And change the line to read

*/5 * * * * php7.4 -f /var/www/nextcloud/cron.php > /dev/null 2>&1

7 Likes