Nextcloud 13 use PHP5.6

Hi

This is my configuration

Nextcloud version (eg, 12.0.2): 13.0.6
Operating system and version (eg, Ubuntu 17.04): Debian GNU/Linux 9.5 (stretch)
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.25 (Debian)
PHP version (eg, 7.1): PHP 7.0.30-0+deb9u1 (cli)

In june i’d upgraded my server from debian 8 to debian 9 and monday i’d upgraded owncloud software from V12 to V13

The problème is that in nextcloud administrator section, nexcloud works with php 5.6 (in french for me):

## Avertissements de sécurité & configuration

Il est important pour la sécurité et la performance de votre instance que tout soit configuré correctement. Pour vous aider dans cette tâche, nous faisons des vérifications automatiques. Veuillez consulter la section Trucs et Astuces et la documentation pour plus d'informations.

* Vous utilisez actuellement PHP 5.6.33-0+deb8u1. Mettez à jour votre version de PHP afin de tirer avantage des améliorations liées à [la performance et la sécurité fournies par le PHP Group](https://secure.php.net/supported-versions.php) dès que votre distribution le supportera.
* Vous utiliser actuellement PHP 5.6. La version majeure actuelle de Nextcloud est la dernière qui est supportée sous PHP 5.6. Il est recommandé de mettre à niveau PHP vers la version 7.0+ pour pouvoir passer à Nextcloud 14.

Merci de consulter les [guides d'installation ↗](https://docs.nextcloud.com/server/13/go.php?to=admin-install) et de vérifier les erreurs ou avertissements des [logs](https://phicloud.phimeca.com/index.php/settings/admin/logging).

What I have to do so that nextcloud work with php 7?

More informations about my server configuration:

# a2query -m
alias (enabled by maintainer script)
headers (enabled by site administrator)
rewrite (enabled by maintainer script)
socache_shmcb (enabled by site administrator)
authn_file (enabled by maintainer script)
dir (enabled by maintainer script)
setenvif (enabled by maintainer script)
authz_user (enabled by maintainer script)
proxy_http (enabled by site administrator)
reqtimeout (enabled by maintainer script)
mpm_prefork (enabled by maintainer script)
autoindex (enabled by maintainer script)
status (enabled by maintainer script)
proxy (enabled by site administrator)
negotiation (enabled by maintainer script)
ssl (enabled by site administrator)
authz_host (enabled by maintainer script)
authz_core (enabled by maintainer script)
mime (enabled by maintainer script)
filter (enabled by maintainer script)
deflate (enabled by maintainer script)
php5 (enabled by maintainer script)
env (enabled by maintainer script)
auth_basic (enabled by maintainer script)
access_compat (enabled by maintainer script)
authn_core (enabled by maintainer script)

# php -v
PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.30-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies

# dpkg -l | grep php
ii  libapache2-mod-php              1:7.0+49                       all          server-side, HTML-embedded scripting language (Apache 2 module) (default)
ii  libapache2-mod-php5             5.6.33+dfsg-0+deb8u1           amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php7.0           7.0.30-0+deb9u1                amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-cli                         1:7.0+49                       all          command-line interpreter for the PHP scripting language (default)
ii  php-common                      1:49                           all          Common files for PHP packages
ii  php-pear                        1:1.10.1+submodules+notgz-9    all          PEAR Base System
ii  php-xml                         1:7.0+49                       all          DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
ii  php-xml-parser                  1.3.4-7                        all          XML parsing class based on PHP's bundled expat
ii  php5                            5.6.33+dfsg-0+deb8u1           all          server-side, HTML-embedded scripting language (metapackage)
ii  php5-apcu                       4.0.7-1                        amd64        APC User Cache for PHP 5
ii  php5-cgi                        5.6.33+dfsg-0+deb8u1           amd64        server-side, HTML-embedded scripting language (CGI binary)
ii  php5-cli                        5.6.33+dfsg-0+deb8u1           amd64        command-line interpreter for the php5 scripting language
ii  php5-common                     5.6.33+dfsg-0+deb8u1           amd64        Common files for packages built from the php5 source
ii  php5-curl                       5.6.33+dfsg-0+deb8u1           amd64        CURL module for php5
ii  php5-gd                         5.6.33+dfsg-0+deb8u1           amd64        GD module for php5
ii  php5-intl                       5.6.33+dfsg-0+deb8u1           amd64        internationalisation module for php5
ii  php5-json                       1.3.6-1                        amd64        JSON module for php5
ii  php5-ldap                       5.6.33+dfsg-0+deb8u1           amd64        LDAP module for php5
ii  php5-mcrypt                     5.6.33+dfsg-0+deb8u1           amd64        MCrypt module for php5
ii  php5-memcached                  2.2.0-2                        amd64        memcached extension module for PHP5, uses libmemcached
ii  php5-mysql                      5.6.33+dfsg-0+deb8u1           amd64        MySQL module for php5
rc  php5-oauth                      1.2.3-1+b1                     amd64        OAuth 1.0 consumer and provider extension
ii  php5-pgsql                      5.6.33+dfsg-0+deb8u1           amd64        PostgreSQL module for php5
ii  php5-readline                   5.6.33+dfsg-0+deb8u1           amd64        Readline module for php5
ii  php5-sqlite                     5.6.33+dfsg-0+deb8u1           amd64        SQLite module for php5
ii  php7.0                          7.0.30-0+deb9u1                all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.0-cgi                      7.0.30-0+deb9u1                amd64        server-side, HTML-embedded scripting language (CGI binary)
ii  php7.0-cli                      7.0.30-0+deb9u1                amd64        command-line interpreter for the PHP scripting language
ii  php7.0-common                   7.0.30-0+deb9u1                amd64        documentation, examples and common module for PHP
ii  php7.0-curl                     7.0.30-0+deb9u1                amd64        CURL module for PHP
ii  php7.0-gd                       7.0.30-0+deb9u1                amd64        GD module for PHP
ii  php7.0-json                     7.0.30-0+deb9u1                amd64        JSON module for PHP
ii  php7.0-mbstring                 7.0.30-0+deb9u1                amd64        MBSTRING module for PHP
ii  php7.0-mysql                    7.0.30-0+deb9u1                amd64        MySQL module for PHP
ii  php7.0-opcache                  7.0.30-0+deb9u1                amd64        Zend OpCache module for PHP
ii  php7.0-readline                 7.0.30-0+deb9u1                amd64        readline module for PHP
ii  php7.0-xml                      7.0.30-0+deb9u1                amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php7.0-zip                      7.0.30-0+deb9u1                amd64        Zip module for PHP

# ls -l /usr/bin/php
lrwxrwxrwx 1 root root 21 nov.   9  2015 /usr/bin/php -> /etc/alternatives/php
# ls -l /etc/alternatives/php
lrwxrwxrwx 1 root root 15 juin  20 10:53 /etc/alternatives/php -> /usr/bin/php7.0

Thank you for your help

up :disappointed_relieved:

You still have php5 enabled. I don’t know about the exact commands, you can disable php5 (a2dismod php5) and then enable php7 (a2enmod php7.0). I’m not sure about the module names. But this is something you do in your webserver setup and Nextcloud only takes the php which is offered there. It is possible that with the default php setup, there are still some php modules missing and this could create some errors.

ok

so i’ll create a backup and remove php5 from my server

1 Like

i’d tried to upgrade my server but at the end i have this message:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

My nextcloud server is an old owncloud server, installed with debian package and after upgrade to nextcloud

so this is what i’m doing for upgrade my server:

To be able to uninstall php5, i must remove old debian packages wich are in hold mode

apt-mark unhold owncloud
apt-mark unhold owncloud-config-apache
apt-mark unhold owncloud-server

put nextcloud in maintenance mode:

sudo -u www-data php occ maintenance:mode --on

stop apache, save owncloud directory and database

/etc/init.d/apache2 stop
rsync -Aavx owncloud/ /home/me/save-owncloud/owncloud-dirbkp_`date +"%Y%m%d"`/
mysqldump -u root -p -q --databases owncloud > /home/me/save-owncloud-base-de-donnees/owncloud_dump_wrk.sql

uninstall old package

apt-get remove owncloud owncloud-config-apache owncloud-server
rm -R /var/www/owncloud/*

uninstall php5

apt-get remove libapache2-mod-php5 php5 php5-apcu php5-cgi php5-cli php5-common php5-curl php5-gd php5-intl php5-json php5-ldap php5-mcrypt php5-memcached php5-mysql php5-oauth php5-pgsql php5-readline php5-sqlite

Install php7

apt-get install php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-json php7.0-gd php7.0-mcrypt php7.0-msgpack php7.0-memcached php7.0-intl php7.0-sqlite3 php7.0-gmp php7.0-geoip php7.0-mbstring php7.0-xml php7.0-zip

i restore owncloud file, directory (preserve right and user)

rsync -Aavx /home/me/save-owncloud/owncloud-dirbkp_20180920/ /var/www/owncloud/

restore database

mysql -u root -p owncloud < /home/me/save-owncloud-base-de-donnees/owncloud_dump_wrk.sql
/etc/init.d/mysql restart

and finally i restart apache2

/etc/init.d/apache2 start

i open the url https://ip/index.php and i have this message:

Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

thank you but i have no information (it’s not a joke) in apache2 log and owncloud server log.

Can someone help me ?

Thank You

by installing php7.0-apcu nextcloud works :crazy_face: but i have an another problem:

Le module php LDAP n’est pas installé, par conséquent cette extension ne pourra fonctionner. Veuillez contacter votre administrateur système afin qu’il l’installe.

translate: php ldap module is not install !!

but i see LDAP user and group backend in activated applications listing !!

What I have to make so that LDAP user and group backend works again ?

many thanks

apt-get install php7.0-ldap :sweat_smile: