OPcache is not properly configured

Nextcloud version (2): 13.0.1
Operating system and version (eg, Ubuntu 17.04): Centos 7.3
Apache or nginx version (eg, Apache 2.4.25): apache 2.4
PHP version (eg, 7.1): PHP 5.6

The issue you are facing:
OPcache is not properly configured

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

opening settings

The output of your Nextcloud log in Admin > Logging:

The PHP OPcache is not properly configured. For better performance it is recommended to use the following settings in the php.ini:

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

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

'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Memcached',
'memcached_servers' => array(
     array('localhost', 11211),
     array('server1.example.com', 11211),
     array('server2.example.com', 11211),
     ),

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

OC\HintException: Memcache \OC\Memcache\Memcached not available for distributed cache

You need to configure this setting in your php.ini file not in the config.php.

1 Like

sorry second one I pasted wrong settings.
I put top settings in php.ini and this in config.php and get error.

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.

‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.distributed’ => ‘\OC\Memcache\Memcached’,
‘memcached_servers’ => array(
array(‘localhost’, 11211),
array(‘server1.example.com’, 11211),
array(‘server2.example.com’, 11211),
),

Hmm you definitely added it to the right php.ini for the right php version /etc/php5/apache2/php.ini and those settings are not overwritten by any other ini (conf.d)?

I would recommend to add it directly to the mods ini file: /etc/php5/mods-available/opcache.ini
By this after activating module the settings are added to all main config files (including cli/php.ini) automatically, overwriting possible other values there. Also syntax errors are just ignored if I remember right, so double check/copy&paste from Nextcloud admin panel.

To check, if webserver itself has right settings, use phpinfo.php: <?php phpinfo(); ?>

Use commandline and type php --ini
You’ll see all ini files in use. If there are opcache settings in the latter file, your settings in php.ini will be overwritten. You’ll need to edit latter file.

Internal server error may be because of error in config…

Don’t know what happend but that message is gone and this below I didn’t put in config.php.
So I think memcached works.

‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.distributed’ => ‘\OC\Memcache\Memcached’,
‘memcached_servers’ => array(
array(‘localhost’, 11211),
array(‘server1.example.com’, 11211),
array(‘server2.example.com’, 11211),
),
[/quote]