Php -issue php7 push it back to 5.6

This is what I got this morning when I tried to login my Nexcloud server. I am running Ubuntu 16.04
server. I can figure this out… I never seen this before

  • @author Lukas Reschke * @author Morris Jobke * @author Robin Appelman * @author Thomas Müller * @author Vincent Petry * * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see * */ // Show warning if a PHP version below 5.6.0 is used, this has to happen here // because base.php will already use 5.6 syntax. if (version_compare(PHP_VERSION, ‘5.6.0’) === -1) { echo ‘This version of Nextcloud requires at least PHP 5.6.0
    ’; echo 'You are currently running ’ . PHP_VERSION . ‘. Please update your PHP version.’; return; } // Show warning if PHP 7.2 is used as Nextcloud is not compatible with PHP 7.2 for now // @see if (version_compare(PHP_VERSION, ‘7.2.0’) !== -1) { echo ‘This version of Nextcloud is not compatible with PHP 7.2.
    ’; echo 'You are currently running ’ . PHP_VERSION . ‘.’; return; } try { require_once DIR . ‘/lib/base.php’; OC::handleRequest(); } catch(\OC\ServiceUnavailableException $ex) { \OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’)); //show the user a detailed error page OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); OC_Template::printExceptionErrorPage($ex); } catch (\OC\HintException $ex) { OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); OC_Template::printErrorPage($ex->getMessage(), $ex->getHint()); } catch (\OC\User\LoginException $ex) { OC_Response::setStatus(OC_Response::STATUS_FORBIDDEN); OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage()); } catch (Exception $ex) { \OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’)); //show the user a detailed error page OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); OC_Template::printExceptionErrorPage($ex); } catch (Error $ex) { \OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’)); OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); OC_Template::printExceptionErrorPage($ex); }

I had the same issue when testing php7, and i reverted back to 5.6 since.
I must give it a shot again in the near future.

Here is a link to the docs (NC11, dont know what you are using):

see if you missed some php modules to install

I don’t understand why so many people only post the error messages and nothing more. Web server and nextcloud logs are pretty much mandatory for problem analysis.

If this long text is what you see in the browser it looks like the PHP interpreter is missing. Otherwise you shouldn’t see any PHP code.

1 Like

I run NC 13-RC1 with PHP 7.2 without prob :slight_smile:


Yes, because NC13 is the first Nextcloud version, that supports PHP7.2.

For Nextcloud 12 the supported versions are PHP 5.6.0 up to 7.1.11. Starting with PHP 7.1.12 Nextcloud throws a lot of error messages in the nextcloud.log but it still runs without noticeable issues.

1 Like

First and for most I am a user of Nextcould not a progaram. I know log file and other froms of help would help you Schmu. What you have to understand is I trust this product, For me it a back and forth thing. I get my hopes all up high then something ike this happens. I dont remember php7 upgrade or doing anything except syncing pictures and music and that is it. Now I do remember doing a upgrade for my Ubuntu Server 16.04, I do this every night. The php7 must have happpen then. I am a help-desk tech myself, I make 50 to 70 calls a day. To me the most inportant thing is good cusotmer service skill set. No one was born 9lb / 8oz with a mouse and keyboard in hand.

Ascendancer: Yes I did revere back to 5.6 but I am still getting this message. When in the cli I used the php -v and see 5.6 but I am still getting this message. I willl check out your the like and hope that I can to revert back to what I had at first.

Hi @eredwood007

I didn’t want to be mean. It is just a little tiring to ask for versions and logs all day long. I just want to clarify that I’m not an employee of Nextcloud (their customer support definitely has better service skills) and only a user trying to help others.
Please don’t feel offended but that comment. It was rather a reminder, that providing most important information will only result in quicker solutions :wink:

There was an issue on Github already about PHP 7.2 and Nextcloud 12.0.4:

There was a bigger discussion and some comments that reverting back is not that easy. You need to check that there are no links on your system pointing to the removed PHP7.2 libraries.
But again: for the message right now you probably need to check your PHP handler (don’t if you use apache or nginx), that will probably show you where the wrong link is defined.

1 Like

As you certainly already noticed, PHP 7.2 won’t be compatible with Nextcloud before version 13 - which is released soon. PHP 7.1 is compatible with version 12 though.

So, revert your backup and wait for Nextcloud 13 is my advice.

And I myself want to aplogize to you my friend and I want to thank you for your help. You know nexcould is assume tool. But sometime it like it will never finish growing. just when you think you have it right. Something else happens. But I keep hanging in there because I know it can be a great program to use. And it makes you have to learn how it works. I am sorry I saw all that code and freek out. And I know you are doing all that you can. I admire you, I want to do more for nexclould but i dont know code like but i am a fast learner I will get my server back to where it was before all of this. Any thank you Schumu


I am not a coder either, so i decided to contribute here a little bit. You are already a part of Nextcloud just by using and learning this software aswell as by posting here. :slight_smile:

I reinstall php 5.6 and I call myself uninstalling php7.0 and now when I try to pull up nextcloud I get a blank page.

This is where I am with the version. : PHP (cli)
Copyright © 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright © 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright © 1999-2016, by Zend Technologies

Seems like you don’t run the official PHP release supplied officially by Ubuntu (PHP 7.0) but instead the PPA from Best thing to do would be to revert to the official Ubuntu PHP packages which support all Nextcloud releases actually.

ok I removed php 5.6 and I am running Ubuntu 16.04 server. I installed php 7.1 and now I get a blank page. What am I doing wrong.

Can someone tell me how to install NC-13 in the commandline ?

please check what configuration is saved on


Since it’s better to have your UI back before upgrading, just to make sure everything is ok.

Hi mate, I believe we had that already: without logs it’s nearly impossible to help you solve the problem :wink:

To install NC13 via commandline:

… DB backup is import, don’t skip that!

  • rename or move your current nextcloud folder; for example
    mv /var/www/nextcloud /var/www/nextcloud_back
  • decompress (unpack) the downloaded archive to your web folder and rename if necessary (for example again /var/www/nextcloud)
  • change ownership and permissions of new decompressed Nextcloud folder according to your environment
    • chown -R www-data:www-data /var/www/nextcloud
    • find /var/www/nextcloud/ -type f -print0 | xargs -0 chmod 0640
    • find /var/www/nextcloud/ -type d -print0 | xargs -0 chmod 0750
  • copy your old config to the new folder
    cp -p /var/www/nextcloud_back/config/config.php /var/www/nextcloud/config/
  • run the upgrade to the new version:
    sudo -u www-data php /var/www/nextcloud/occ upgrade
  • disable Maintenance Mode:
    sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off

That should be it.

Ok I see what you are saying Schmu and you right log are there to help or give you a better ideal as to what’s going on. I am still new to nextcloud my and to linux. So my next questioln would be what logs should I copy and past. To help you help me ? I really dont want to reinstall nextclould I really how to trouble shot this an fix it.

Can you please provide:

  • path to your nextcloud installation e.g. /var/www/nextcloud/
  • path to your datafolder e.g. /var/ncdata/
  • web server used (apache, nginx, …)

For now I assume your paths match the above examples. If not adapt to your environment please. We would need then:

  • /var/ncdata/nextcloud.log
  • /etc/nginx/logs/error.log or /var/log/apache2/error.log

Before providing the logs, please do the following:

  • edit /var/www/nextcloud/config/config.php
    • search for ‘loglevel’
    • set to 'loglevel' => 0,
    • save that change
  • access your NC server again via web browser
  • now collect the logs and provide them here

Also, please post your web server config.
Could be all files under/etc/apache2/sites-enabled/ if you use apache.

That should do for now.