Cannot configure PHP Opcache

NethServer Version: 7.3.1611 (Final)
Module: Nextcloud

Info

Nextcloud version 12.0.0.29:
Operating system and version _NethServer release 7.3.1611 (Final)
(basado en _:
Apache vesion: _httpd-2.4.6-45.el7.centos.4.x86_64
PHP version (eg, 5.6):
Is this the first time you’ve seen this error?: No

Steps to replicate:

  1. Verify apcu module is installed and enabled:

    root  ~  php -v
    PHP 5.6.25 (cli) (built: Oct 21 2016 18:00:07)
    Copyright © 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright © 1998-2016 Zend Technologies
    root  ~  php -m | grep -i pcu
    apcu
    root  ~  grep enabled /etc/opt/rh/rh-php56/php.d/40-apcu.ini
    apc.enabled=1

  2. Verify opcach_* options set:

    root  ~  vi /etc/opt/rh/rh-php56/php-fpm.conf
    root  ~  grep include /etc/opt/rh/rh-php56/php-fpm.conf
    ; Include one or more files. If glob(3) exists, it is used to include a bunch of
    include=/etc/opt/rh/rh-php56/php-fpm.d/*.conf
    root  ~  tail -20 /etc/opt/rh/rh-php56/php-fpm.d/www.conf
    00
    ; Default Value: nothing is defined by default except the values in php.ini and
    ; specified at startup with the -d argument
    ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
    ;php_flag[display_errors] = off
    php_admin_value[error_log] = /var/opt/rh/rh-php56/log/php-fpm/www-error.log
    php_admin_flag[log_errors] = on
    ;php_admin_value[memory_limit] = 128M

    ; Set session path to a directory owned by process user
    php_value[session.save_handler] = files
    php_value[session.save_path] = /var/opt/rh/rh-php56/lib/php/session
    php_value[soap.wsdl_cache_dir] = /var/opt/rh/rh-php56/lib/php/wsdlcache
    opcache.enable=1
    opcache.enable_cli=1
    opcache.interned_strings_buffer=8
    opcache.max_accelerated_files=10000
    opcache.memory_consumption=128
    opcache.save_comments=1
    opcache.revalidate_freq=1

(I’ve tried adding those parameters in /usr/share/nextcloud/.user.ini with the same result)

  1. Add lines to /usr/share/nextcloud/config/config.php :

'memcache.local' => '\OC\Memcache\APCu',


The issue I am facing:

I get the following warnings:

No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.
The PHP Opcache is not properly configured.

The output of my Nextcloud log in Admin > Logging:

OC\HintException: Memcache \OC\Memcache\APCu not available for local cache at /usr/share/nextcloud/lib/private/Memcache/Factory.php#96

The output of my config.php file

<?php
$CONFIG = array (
  'passwordsalt' => 'Holis',
  'secret' => 'Chaupis',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'muteriver.infoestructura.local',
    2 => '192.168.50.8',
    3 => 'infoestructura.local',
  ),
  'datadirectory' => '/var/lib/nethserver/nextcloud/',
  'overwrite.cli.url' => 'http://localhost',
  'dbtype' => 'mysql',
  'version' => '12.0.0.29',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'HEY',
  'installed' => true,
  'instanceid' => 'ocmstnc1xrkf',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'maintenance' => false,
  'updater.secret' => '$2y$#0$rK1f%eiH/TXsssssssssssssssssssssssHzi9N79Ta1D17ö4hÑ6',
);

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

192.168.50.47 - - [23/Aug/2017:15:06:31 -0300] "GET /nextcloud/core/vendor/jsTimezoneDetect/jstz.js?v=267bdad1cab11800275b289f598573ad-0 HTTP/1.1" 200 14565
192.168.50.47 - - [23/Aug/2017:15:06:31 -0300] "GET /nextcloud/index.php/js/core/merged-login.js?v=267bdad1cab11800275b289f598573ad-0 HTTP/1.1" 200 1867
192.168.50.47 - - [23/Aug/2017:15:06:32 -0300] "GET /nextcloud/index.php/apps/theming/js/theming?v=0 HTTP/1.1" 200 203
192.168.50.47 - - [23/Aug/2017:15:06:32 -0300] "GET /nextcloud/core/img/background.jpg?v=0 HTTP/1.1" 200 95212
192.168.50.47 - - [23/Aug/2017:15:06:32 -0300] "GET /nextcloud/core/img/logo.svg?v=0 HTTP/1.1" 200 1232
192.168.50.47 - - [23/Aug/2017:15:06:32 -0300] "GET /nextcloud/core/img/actions/confirm-white.svg?v=2 HTTP/1.1" 200 841
192.168.50.47 - - [23/Aug/2017:15:06:32 -0300] "GET /nextcloud/core/fonts/OpenSans-Regular.woff HTTP/1.1" 200 20544
192.168.50.47 - - [23/Aug/2017:15:06:32 -0300] "GET /nextcloud/core/fonts/OpenSans-Light.woff HTTP/1.1" 200 62844
192.168.50.47 - - [23/Aug/2017:15:06:32 -0300] "GET /nextcloud/core/fonts/OpenSans-Semibold.woff HTTP/1.1" 200 69888
192.168.50.47 - - [23/Aug/2017:15:06:32 -0300] "GET /nextcloud/cron.php HTTP/1.1" 200 20

Please could you help me?

Thanks in advance!

Recently we added some notes in the [wiki]
(https://wiki.nethserver.org/doku.php?id=howto:nextcloud)

1 Like

Really thanks @dnutan

I’ve followed those steps but I get the same error :frowning:

“The PHP Opcache is not properly configured.”

:confounded:

What could be wrong?

Thanks in advance

The information in the wiki is an excerpt of this discussion.
Have you undone your previous changes (.user.ini, www.conf)?

Hi @alfred, did you found a solution?
BTW, we have added some notes on APCu to the wiki.