Can't get the upgrade from php7.2 to php7.4 to work

Nextcloud version (eg, 18.0.2): 19.0.0
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04.3
Apache or nginx version (eg, Apache 2.4.25): 2.4.43
PHP version (eg, 7.1): currently still 7.2, want to go to 7.4

The issue you are facing:

I want to have my nextcloud install use php7.4 instead of 7.2. Have searched a lot in the forum as well as other php upgrade related sites, but am not getting it to work.

I have installed php7.4 including the modules which are currently in the php7.2 installation (there are 3 more modules in the 7.4 installation. I can’t install the wddx module for 7.4 as this does not seem to exist.

php7.2 -m php7.4 -m
[PHP Modules] [PHP Modules]
bcmath bcmath
bz2 bz2
calendar calendar
Core Core
ctype ctype
curl curl
date date
dom dom
exif exif
fileinfo fileinfo
filter filter
ftp ftp
gd gd
gettext gettext
gmp gmp
hash hash
iconv iconv
imap imap
intl intl
json json
ldap ldap
libsmbclient libsmbclient
libxml libxml
mbstring mbstring
openssl openssl
pcntl pcntl
pcre pcre
pdo_pgsql pdo_pgsql
pgsql pgsql
Phar Phar
posix posix
readline readline
Reflection Reflection
session session
shmop shmop
SimpleXML SimpleXML
smbclient smbclient
soap soap
sockets sockets
sodium sodium
standard standard
sysvmsg sysvmsg
sysvsem sysvsem
sysvshm sysvshm
tokenizer tokenizer
xml xml
xmlreader xmlreader
xmlwriter xmlwriter
xsl xsl
Zend OPcache Zend OPcache
zip zip
zlib zlib
[Zend Modules] [Zend Modules]
Zend OPcache Zend OPcache

I set the php version to php4 (alternative version).

php --version

I copied the file /etc/php/7.2/fpm/pool.d/nextcloud.conf to /etc/php/7.4/fpm/pool.d and modified the Handler.


The php7.4-fpm service is running (as well as the php7.2-fpm service).

To my knowledge, this should cover the php installation/configuration.

Onwards to Apache:

I disabled module php7.2 (a2dismod php7.2) and enabled php7.4-fpm (a2enconf php7.4-fpm).

In /etc/apache2/sites-enabled/nextcloud_ssl_domain_self_signed.conf I changed the line with the php version:

Afterwards restarted Apache. The only thing that I get is “Internal Server Error” and can’t find a logfile with a meaningful error message which might point me in a possible resolution.

Would appreciate a helpful hint a lot. I’m stuck :frowning:


You copied the nextcloud.conf to /etc/php/7.4/fpm/pool.d. Did you modify it after copying? There are references to the php version in it. You also have to restart the php7.4-fpm service.

I did modify nextcloud.conf (replaced 7.2 with 7.4) and restarted php7.4-fpm service aftwards.

1 Like

I think the better way is to upgrade from Ubuntu 18.04 LTS to 20.04 LTS . Then you get the new PHP version.

I think Nextcloud 19 is the last version you can use with the php version. You have a few months to dist-upgrade to Ubuntu 20.04 LTS or only change the php-version. You also can use Nextcloud 19 after release of 20 and 21.

1 Like

Today I upgraded my NC instance from Ubuntu 18.04 to 20.04. I still have the issue, that I can’t switch to PHP 7.4.

For my Apache virtual server used for NC, I currently have the following handler set:

SetHandler "proxy:unix:/run/php/php7.2-fpm.nextcloud.sock|fcgi://localhost"

/etc/php/7.2/fpm/pool.d/nextcloud.conf the following is set


So far, so good, this is the configuration which is working, but would like to move to PHP 7.4.

I copied /etc/php/7.2/fpm/pool.d/nextcloud.conf to /etc/php/7.4/fpm/pool.d/nextcloud.conf and modified the “listen” entry to:

listen = /run/php/php"7.4"-fpm.nextcloud.sock

Restarted php7.4-fpm (systemctl restart php7.4-fpm.service).

Now, as soon as I change the SetHandler entry for the Apache virtual server for NC to

SetHandler "proxy:unix:/run/php/php7.4-fpm.nextcloud.sock|fcgi://localhost"

and restart Apache, I get the following:

The only I can get into my NC, is to revert back the Apache config to 7.2.

Would appreciate your help, am stuck.


Did some further analysis. When I replace index.php with a version to get PHP info, I do get the information, that PHP 7.4 is being used.

Which lead me to think I could get some more information from the original index.php file. I did find “my” error message in there (at the bottom):

require_once __DIR__ . '/lib/versioncheck.php';

try {
        require_once __DIR__ . '/lib/base.php';

} catch (\OC\ServiceUnavailableException $ex) {
        \OC::$server->getLogger()->logException($ex, ['app' => 'index']);

        //show the user a detailed error page
        OC_Template::printExceptionErrorPage($ex, 503);
} catch (\OC\HintException $ex) {
        try {
                OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503);
        } catch (Exception $ex2) {
                try {
                        \OC::$server->getLogger()->logException($ex, ['app' => 'index']);
                        \OC::$server->getLogger()->logException($ex2, ['app' => 'index']);
                } catch (Throwable $e) {
                        // no way to log it properly - but to avoid a white page of death we try harder and ignore this one here

                //show the user a detailed error page
                OC_Template::printExceptionErrorPage($ex, 500);
} catch (\OC\User\LoginException $ex) {
        OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 403);
} catch (Exception $ex) {
        \OC::$server->getLogger()->logException($ex, ['app' => 'index']);

        //show the user a detailed error page
        OC_Template::printExceptionErrorPage($ex, 500);
} catch (Error $ex) {
        try {
                \OC::$server->getLogger()->logException($ex, ['app' => 'index']);
        } catch (Error $e) {
                header('Content-Type: text/plain; charset=utf-8');
                print("Internal Server Error\n\n");
                print("The server encountered an internal error and was unable to complete your request.\n");
                print("Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.\n");
                print("More details can be found in the webserver log.\n");

                throw $ex;
        OC_Template::printExceptionErrorPage($ex, 500);

Unfortunately my PHP knowledge is very limited. I do understand it checks a few things and throws an exception when a check fails. What I can’t read out of those lines, is at what kind of check it stumbles to give me the error message I see when I configure 7.4 for the site.

Could anybody give me a hint what it might be?


Another day went by and one step forward was made!

I removed the following entries from config.php and restarted apache.

‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,

I am now able to logon and the system page shows me PHP 7.4.8!


Ofcourse the overview page is now complaining now caching is activated, which I will not have to look at. But at least I was able to narrow down, where the issue is.

With the problem area known, the solution was quite easy. I had to install two additional php packages (I compared the packages installed for 7.2 and 7.4 and these two did not popup for 7.2):

apt install php-redis
apt install php-apcu

After installation and restart von apache, all was fine. Ready for NC 20. :wink:

1 Like

Sorry i use Debian GNU/Linux. But i never set the php-configuration in then apache2-configuration-file. But i always uses the standard-release with the standard-php-installation.

If you have dist-upgraded your Ubuntu-installation you can install
sudo apt-get install apt-show-versions

and test for old not-focal packages.

apt-show-versions |grep -v focal
(not tested, perhaps you can delete them)

There could be old php 7.2 - packages.
Perhaps with dist-upgrade to Ubuntu 22.04 LTS you can direct delete old packages.

1 Like