This version of Nextcloud requires at least PHP 7.X message after updating Ubuntu

Nextcloud version: 20.X
Operating system and version: Ubuntu 20.04.1 LTS
Apache: Apache2
PHP version: 7.4

The issue you are facing:

After updating Ubuntu, I get the following message on my Nextcloud login page:

This version of Nextcloud requires at least PHP 7.2
You are currently running Please update your PHP version.

However, I do not have PHP 7.1. I have 7.4.

Is this the first time you’ve seen this error? Yes

Steps to replicate it:

  1. Updated Ubuntu
  2. Restarted machine
  3. Nextcloud started showing this message

The message states different though. Any good reason why you are using Ondřej Surý’s PHP PPA package instead of simply using the official Ubuntu PHP repos on your server?

What is (from the CLI)
php -v

1 Like

Probably because the guide I followed to setup NC used it too.

Hi @Odenkaz

Which guide did you follow? And what does php -v say?

This is the guide:
NC Setup guide

php -v gives the following result:

PHP 7.4.3 (cli) (built: Aug 13 2021 05:39:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

Maybe you have both PHP versions installed. If you don’t need both, make sure that you uninstall all 7.1 packages…

apt remove php7.1-*

if that doesn’t help, you could purge everything PHP related, including all the config files…

apt purge php*

…and then explicitly install a specific version and reconfigure it. Make sure that you install all required packages and you configure them properly. Be aware that there are speparate config files for each major version if you use Sury’s PPA. And if you purged all PHP packages all configuration changes have to be made again after you have reinstalled the pakages…

I use the PHP-FPM configuration from Carsten Rieger on my server. See the section Installation PHP 7.4 (alternativ php8.0-fpm) in the following tutorial:

If you want to keep your config simpler you could also use the PHP-FPM config from here or of course from the offiical docs…


I guess the PHP config from the guide you used, is fine too…

1 Like