PHP 7.2 Not working & OPcache now enabling


#1

Nextcloud version _: 13.02
Operating system and version _: Ubuntu 16.04
Apache or nginx version : Apache/2.4.18
PHP version
: 7.2.5 (On next cloud it says 7.0.30)

The issue you are facing:
PHP 7.2.5 is not pulling being recognized by NextCloud despite that when you do php -v I receive the following

PHP 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May  5 2018 04:59:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.5-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

On top of this, I am getting the error in the Admin Settings of

The PHP OPcache is not properly configured

But then in the php.ini it is enabled

Is this the first time you’ve seen this error? (Y/N):
Yes as this is my first instance from moving from OwnCloud

Steps to replicate it:

No steps available

The output of your Nextcloud log in Admin > Logging:

Error	core	cURL error 7: Failed to connect to cloud.nastuzzi.fr port 443: No route to host
Fatal	webdav	OCP\Files\InvalidPathException: 	8 hours ago
Error	core	cURL error 7: Failed to connect to cloud.nastuzzi.fr port 443: No route to host	8 hours ago
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Encryption not ready: No default encryption module defined
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Encryption not ready: No default encryption module defined
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Encryption not ready: No default encryption module defined
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Encryption not ready: No default encryption module defined

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocmypbgmlf3c',
  'passwordsalt' => '9SZ6IPdoR3hG+RawXZoWVOfVVj9PGC',
  'secret' => 'icfBxiySaYWLWrvv6d0OuAe0RRsHwO514GXwgn4ilnIUtB+/',
  'trusted_domains' => 
  array (
    0 => 'cloud.pinklama.studio',
  ),
  'datadirectory' => '/var/www/html/data',
  'overwrite.cli.url' => 'domain.com',
  'dbtype' => 'mysql',
  'version' => '13.0.2.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'dbuser',
  'dbpassword' => password',
  'installed' => true,
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'cloud',
  'mail_domain' => 'domain.com',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'domain.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'email@domain.com',
  'mail_smtppassword' => 'Password',
  'mail_smtpsecure' => 'ssl',
  'theme' => 'theme',
  'knowledgebaseenabled' => false,
  'htaccess.RewriteBase' => '/',
  'logtimezone' => 'Europe/London',
);

The output of your Apache/nginx/system log in /var/log/____:

[Sat May 26 20:02:52.714923 2018] [mpm_event:notice] [pid 16728:tid 140365669201792] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat May 26 20:02:52.715358 2018] [core:notice] [pid 16728:tid 140365669201792] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 26 20:04:16.519031 2018] [mpm_event:notice] [pid 16728:tid 140365669201792] AH00491: caught SIGTERM, shutting down
[Sat May 26 20:04:16.813992 2018] [mpm_prefork:notice] [pid 23338] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat May 26 20:04:16.814355 2018] [core:notice] [pid 23338] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 26 20:04:19.275337 2018] [mpm_prefork:notice] [pid 23338] AH00169: caught SIGTERM, shutting down
[Sat May 26 20:04:20.719258 2018] [mpm_prefork:notice] [pid 23446] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat May 26 20:04:20.719424 2018] [core:notice] [pid 23446] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 26 21:23:41.856520 2018] [:error] [pid 23452] [client 120.92.164.3:51700] script '/var/www/html/index.php' not found or unable to stat
[Sat May 26 22:20:16.847607 2018] [mpm_prefork:notice] [pid 23446] AH00169: caught SIGTERM, shutting down
[Sat May 26 22:20:18.245894 2018] [mpm_prefork:notice] [pid 21834] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat May 26 22:20:18.246069 2018] [core:notice] [pid 21834] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 26 22:23:40.038802 2018] [mpm_prefork:notice] [pid 21834] AH00169: caught SIGTERM, shutting down
[Sat May 26 22:23:41.445871 2018] [mpm_prefork:notice] [pid 22095] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat May 26 22:23:41.446050 2018] [core:notice] [pid 22095] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 26 22:34:03.655458 2018] [mpm_prefork:notice] [pid 22095] AH00169: caught SIGTERM, shutting down
[Sat May 26 22:34:58.221929 2018] [mpm_prefork:notice] [pid 937] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat May 26 22:34:58.239354 2018] [core:notice] [pid 937] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 26 22:37:11.185198 2018] [mpm_prefork:notice] [pid 937] AH00169: caught SIGTERM, shutting down
[Sat May 26 22:37:12.818583 2018] [mpm_prefork:notice] [pid 11581] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat May 26 22:37:12.818758 2018] [core:notice] [pid 11581] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 26 22:39:08.156929 2018] [mpm_prefork:notice] [pid 11581] AH00169: caught SIGTERM, shutting down
[Sat May 26 22:39:09.609452 2018] [mpm_prefork:notice] [pid 13086] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat May 26 22:39:09.609614 2018] [core:notice] [pid 13086] AH00094: Command line: '/usr/sbin/apache2'
[Sat May 26 22:40:35.020273 2018] [mpm_prefork:notice] [pid 13086] AH00169: caught SIGTERM, shutting down
[Sat May 26 22:40:36.233893 2018] [mpm_prefork:notice] [pid 15210] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations


Internal Server Error after php upgrade (7.0 to 7.2)
#2

I guess you installed PHP7.2 after using PHP7.0?

As different PHP versions can be installed beside each other, did you assure that Apache uses 7.2? E.g.:
a2dismod php7.0
a2enmod php7.2


#3

Okay so I ran that command and now OwnCloud is using 7.2 which is a good start. I have now also fixed the opcache issue. Thanks for the support and quick response


#4

Great to hear, your welcome :slight_smile:.


#5

Hello,

i’m facing the same problem but with lighttpd. is there an equivalent command?

GReetings
D1Ck3n


#6

Is it the same that you updated PHP to v7.2?
Does PHP (7.2) not run or is it just the OPCache warnings on admin panel?
If you run Lighttpd, I guess you use php-fpm?
And with OS/distro do you use?


#7

yes, i updated the php Version from 7.0 to 7.2.
i want NC to use 7.2 instead of 7.0 but i don’t know how to “tell” NC to do so :frowning:
yes, i use php-fpm. I tried to change this config: /etc/lighttpd/conf-available/15-fastcgi-php.conf but after changing 7.0 to 7.2 i get internal server error.

I use dietpi (minimal Debian 9 installation)


#8

If you use DietPi than by chance you found the right one :smile:.

You installed PHP, webserver and such (at best whole Nextcloud) via dietpi-software?
Did you install PHP7.2 via Ondrejs repo https://deb.sury.org/?

"socket" => "/var/run/php/php7.2-fpm.sock", in /etc/lighttpd/conf-available/15-fastcgi-php.conf indeed should be it, if php7.2-fpm service is correctly installed and running. But note that Nextcloud is configured (via dietpi-software) to use the php-redis and php-apcu modules, which are not by default installed together with PHP. Missing those, leads to internal server errors, so most likely this is the issue in your case.

Those modules from Debian Stretch repo are PHP7.0 versions, so you need to install them from Ondrej’s repo as PHP7.2 versions. Hope they are contained there, will check and see.

Quick test which might or might not work:

apt install php-redis php-apcu # Failing that, skip the following
phpenmod redis apcu
systemctl restart php7.2-fpm

EDIT

Okay, just checked and on Ondrej’s repo the packages are called php-redis and php-apcu as well. Not sure if priority pins are required to force fulling these version, but AFAIK this is done automatically. Did you force installing/updating them? I adjusted the commands above, or do simply apt upgrade and check that/if those two packages are updated as well.
Check back their versions and generally installed PHP packages: dpkg -l | grep 'php'
And/or check if the related modules are available and enabled for PHP7.2:

ls -l /etc/php/7.2/mods-available
ls -l /etc/php/7.2/apache2/conf.d/

Should list

apcu.ini
redis.ini

respectively

20-apcu.ini
20-redis.ini

#9

OMG That’s the solution!! Thank you very much!! now NC is running php7.2 :slight_smile:


#10

Great. Just note that dietpi-software did/will expect PHP7.0 to be installed, thus some configuration steps fail or will be skipped for PHP7.2.

Not a really big issue, perhaps later I can give you some steps to apply the intended config edits to PHP7.2 as well. Not critical but applies some stuff like max upload size and cache sizes according to your system.