How to update PHP NC 19.0.0?

Sounds about right. Go for PHP 7.4, it works great with Nextcloud.

“About right” or totally right? :stuck_out_tongue:

I don’t wanna break my Nextcloud :wink:
(Yes of course i have a backup)

You won’t break your Nextcloud. You can easily install PHP 7.4 beside 7.2. If anything does not work, you can switch back to 7.2. I have 4 instances of Nextcloud running on 7.4 now for some months, no problem.

Since we/me are here to learn :slight_smile: How do i switch back?

You should have a reference to php7.2 in your vhost configuration. That’s how it works with Apache, I don’t know nginx, but should be similar. Just change that.

Have a look here (below). Can replace 7.3 with 7.4…
As long as you run Apache and MariaDB/MySQL it should work even on non-RasPI…

@anon71540698, this is pretty different than what @eehmke is telling me to do. so what is the best way to do this? :slight_smile:

I run the Hansson VM (on an ESX server) by the way, this one:

I have tried the commands in my startpost, and Nextcloud is still telling me:

Je draait momenteel PHP 7.2.24-0ubuntu0.18.04.6. We adviseren je om, zo gauw je distributie dat biedt, je PHP versie bij te werken voor betere prestaties en beveiliging geleverd door de PHP Group.

Let’s start from scratch. I assume you have command line access. What is the output of this commands:

sudo dpkg -l | grep php
php -v

Do you have apache or nginx installed? If apache, what is the content of directory


sudo dpkg -l | grep php shows me:

a couple of lines with php7.2… and php7.4…

php -v shows me:

PHP 7.4.6.

the apache2/sites-available directory holds:

So PHP 7.4 is installed. What is the content of


There should be a symlink to one of the files in sites-available. Show us the content of that file.

Only holds:

So not the same as sites/availabe…

my nextcloud url is btw.

Is an actual file or a symlink? It should be a symlink to sites-available. Anyway please post the content of that file. Remove/replace domain information.

when i enter vi it shows:

<VirtualHost *:80>
Redirect /

<VirtualHost *:443>

Header add Strict-Transport-Security: "max-age=15768000;includeSubdomains"
SSLEngine on
SSLCompression off
SSLProtocol all -TLSv1 -TLSv1.1 -SSLv2 -SSLv3
SSLHonorCipherOrder on




<FilesMatch "\.php$">
    SetHandler "proxy:unix:/run/php/php7.2-fpm.nextcloud.sock|fcgi://localhost"

DocumentRoot /var/www/nextcloud

<Directory /var/www/nextcloud>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Satisfy Any

<IfModule mod_dav.c>
Dav off

SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud

# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
<Files ".ht*">
Require all denied

# Disable HTTP TRACE method.
TraceEnable off
# Disable HTTP TRACK method.

So you have a handler for php.7.2-fpm:

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

So you have to set this up for php7.4, restart the fpm handler, change the line in your and restart apache.

Tell us if you need help with these steps. They are quite straightforward.

I have changed the 7.2 into an 7.4 (and rebooted) but now when i try to open my cloud the error is:

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

(i have edited the file in /etc/apache2/sites-enabled)

This could mean a number of things, but in the end all point to PHP not working properly:

  • is php7.4-fpm running?
  • are all necessary php7.4 packages installed? The database module might be missing (e.g. php7.4-mysql)

Also, (it’s a bit annoying in Debian-based systems) you have to manually port the changes you made to the php7.2 configuration files (in /etc/php/7.2/fpm/... to the 7.4 directory. This e.g. concerns upload size and memory limits.

I wish i hadn’t have to ask…but how do i check if php fpm is running? And how do i check if all necessary packages are installed?

I don’t understand what you mean by port changes, what do i need to do? (Exactly :wink: )

I told you to set up the fpm handler for 7.4 .

There should be a file in


that refers to your fpm config. Copy it to


and edit it, replace all occurences of 7.2 to 7.4.

sudo systemctl restart php7.4-fpm.service

now restart apache. You don’t have to reboot, this is not windows.

Sorry you did say that. Will give it a try.