Debian 9 PHP version too old for Nextcloud 16

Just throwing this into the conversation. Debian stable tends to use much older software because it’s been around long enough to trust it as “stable.” That’s a good approach for a lot of things, but when talking about live web servers you have to consider security updates which need to happen often. If you’re using Debian to run a web server (which is totally reasonable), you just have to decide if you want to run all the older “stable” software in your web stack, or keep all the web stack software up to date (Apache/Nginx, PHP, Nextcloud, etc.). I guess the trade off is between stability and security, but for me I would recommend erring on the side of security when dealing with a live web server.
Not to mention that sometimes if you want the new features/efficiencies of the latest Nextcloud, that might depend on some of the new PHP language features.

on debian 9 I installed apache and php repository and got last apache2 and last php 7.3 armhf. on Raspberry pi3b + raspbian. and I solved it. unfortunately not for pizero w which is armv6 not supported by although it has raspbian stretch the same.


  1. sudo apt-get -y install apt-transport-https lsb-release ca-certificates

  2. sudo wget -O /etc/apt/trusted.gpg.d/php.gpg

  3. sudo sh -c ‘echo “deb $(lsb_release -sc) main” > /etc/apt/sources.list.d/php.list’

  4. sudo apt update && sudo apt dist-upgrade


  1. sudo apt-get -y install apt-transport-https lsb-release ca-certificates

  2. sudo wget -O /etc/apt/trusted.gpg.d/apache2.gpg

  3. sudo sh -c ‘echo “deb $(lsb_release -sc) main” > /etc/apt/sources.list.d/apache2.list’

  4. sudo apt update && sudo apt dist-upgrade

1 Like

in this way I had apache update and was able to install php 7.3 / php7.3-fpm on raspbian stretch pi3b +, but the same is true for debian 9 official.

sudo apt-get install php7.3 libapache2-mod-php7.3 php7.3-cli php7.3-common php7.3-mbstring php7.3-gd php7.3-intl php7.3-xml php7.3-mysql php7.3-zip php7.3-curl php7.3-ldap php7.3-bz2 php-ssh2 php-apcu php-smbclient php-imagick libmagickcore-dev -y

1 Like

For php7.3-fpm

  1. sudo systemctl stop apache2

  2. sudo apt-get install php7.3-fpm

  3. sudo a2enmod proxy_fcgi setenvif

  4. sudo a2enconf php7.3-fpm

  5. sudo a2dismod php7.3

  6. sudo a2dismod mpm_prefork

  7. sudo a2enmod mpm_event

  8. sudo systemctl start apache2

1 Like

I recently tried to upgrade to PHP 7.3 using the repo, following all the proper guides and installing all of the packages, as well as keeping the stable Debian 7.0 release. When I did this and changed to php7.3, I got a 500 server error, even after restarting the entire server. I tried then to go back to 7.0 and was still receiving the error.

I run Nginx, and not Apache, and would love if someone posted a guide to upgrade for Nginx, because a2dismod and enmod do not work for Nginx (as im sure most know). I have not been able to find a guide for anything other than Apache2.

Any help is appreciated here.

Just hold off on adding secondary repositories. It just creates problems down the road and opens up vulnerabilities. Debian 10 will be out soon and the issue will be solved.

to stay with old packages closes them?

the issue is a zombie and will appear in form of python 4 and php 8 soon.

I think you should post a new topic with logs etc. It will be easier to get help.

Agree the issue will just come up again with Debian. Not just here either, but with other software. Still sticking with Debian stable on servers though.

As to those concerned about the security of old Debian software…Debian issues their own security fixes for software in stable almost as fast as Arch.

You might find this howto I wrote helpful… Should work almost unchanged for Ubuntu 18.04 or Debian 9+…


Not sure my 2 cents will matter, but I agree with schnappi, I stick with Debian 9 stable which has been serving me well over the years … each attempt at upgrading PHP lead at some points to issues … web servers by essence hosts many different things and a PHP upgrade can break stuff that you discover way later because you didn’t take the time to check each and every page of the 150 websites hosted on the machine.

I won’t say I’d prefer Debian to update more frequently, of course, but I’m more annoyed by PHP updating their product at such a high pace and outdating very recent products … I see still thousands of websites running PHP 5 …

Anyway, that was not the reason for my message: I just saw that I am suddenly offered to update NC to 16.0.3 (from 15.0.10), and I am still (as you might have guessed) on Debian 9 stable, ie PHP 7.0.33. Is there a place where I can check this, a place where it would be clearly stated that now NC 16 supports PHP 7.0.33 ? Updating to 16 was not an option as of a few days ago unless I am mistaken.


Nextcloud 16 requires PHP 7.1, 7.2 or 7.3
It will not work with PHP 7.0

my playbook just told me:

TASK [prep_nextcloud : first setup nextcloud] **********************************************************************************************************
Monday 15 July 2019  19:44:12 +0000 (0:00:00.545)       0:07:08.123 ***********
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "php occ  maintenance:install  --database pgsql  --database-host \"localhost\"  --database-name nextcloud  --database-table-prefix oc_  --database-user nextcloud  --database-pass aKo3X56if2ehbtzQANhqvH4vQmqZ5EHf  --admin-user admin  --admin-pass XP6R4zT8J4VMHbLGZGkxNcWqBFYQaGi4  --data-dir /var/nc-data\n", "delta": "0:00:00.039882", "end": "2019-07-15 19:44:13.063709", "msg": "non-zero return code", "rc": 255, "start": "2019-07-15 19:44:13.023827", "stderr": "", "stderr_lines": [], "stdout": "This version of Nextcloud requires at least PHP 7.1<br/>You are currently running Please update your PHP version.", "stdout_lines": 
["This version of Nextcloud requires at least PHP 7.1
You are currently running Please update your PHP version."]}

should be the same on debian.

on the other hand: the playbook runs on debian 9 with php 7.3.7 without problems.

and nextcloud is using debian as the base image for there docker images.

i remember when half of the german internet was hosted on one sun fire 6500. guess why they use virtualization and container now. :wink:


Sorry but I perfectly know about all this (requirements and warnings about running 7.0.33 and I already went to the documentation, thank you) and maybe my question was not phrased properly (english is not my main language)

I am suddenly et very recently proposed with upgrading to 16.0.3 (I was not before until I would say a week ago), so I’m wondering if something changed (and that could explain the doc not being updated).
And if nothing changed I think it’s kind of dangerous to propose the upgrade, I know many people who will try and … ooops. I guess that there are some limits and minimum requirements that have to be met for an installation to propose an upgrade, so I think it’s curious that I can now launch that upgrade … maybe I will get some warnings later during the process (hopefully soon enough :slight_smile:

Anyway, maybe I’ll try on a test install to see by myself.

i guess 16.0.3 is the “production” release of nc16. so if you set your update channel to production it is offered to you. and yes, that’s a bad bug.


my playbook could be helpfull. just install php 7.0 and nextcloud 15 and do the update manually.

I’m just removing a Nextcloud from Debian because of the “crusty and old” PHP issues. Mine is Debian 8 so I’m in even more of a pinch…I’ve given up on Linux for old and stable. It stays stable, but way too old unless you backport or upgrade your OS. Save yourself some headache and learn FreeBSD. They have PHP 7.1, 7.2, and 7.3 in their ports and it actually isn’t a death march to upgrade between major and minor releases. Not a direct resolution to the problem, but once you go FreeBSD you don’t wanna go back.