Hi,
I keep on receiving the PHP opcache error in my admin console warning me to adapt my php.ini
file to improve perfomance:
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 looked up which php.ini
is loaded php -i | grep php.ini
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
I’ve changed the php.ini in question accordingly to the recommendations and restarted nginx, but no results.
I’ve als tried add these lines to the file /etc/php5/cli/conf.d/05-opcache.ini
but the warning still remains.
Any idea what else I can do?
My setup:
Raspberry 3
os: Openmediavault3 (=Debian 8)
Nginx
php5
kr,
wouter
I solved it by adding the code to /etc/php5/fpm/php.ini
instead and performing the command ‘service php5-fpm restart’ afterwards. Problem solved
I have exactly the same problem, but my variable opcache.restrict_api points to the correct directory.
The variable is stored in /etc/php/8.0/fpm/pool.d/nextcloud.conf which is also loaded by nextcloud.
devnull
February 19, 2022, 10:27am
4
@Tealk144
Have you read this?
PHP bundles the Zend OPcache in core since version 5.5, so you don’t need to install an opcache manually.
Memory caching — Nextcloud latest Administration Manual latest documentation
Have you activated memory caching?
(sudo) apt-get install php-apcu
config/config.php
‘memcache.local’ => ‘\OC\Memcache\APCu’,
Post after that the errors in your Nextcloud.
No i use the redis cache:
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
Mabe you can deactivate Redis (not really useful for single servers) and activate APCu .
I’m not quite sure right now why this should affect the opcache message?
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.distributed' => '\\OC\\Memcache\\APCu',
'memcache.locking' => '\\OC\\Memcache\\APCu',
Still:
php.ini
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
opcache.enable_cli=1
; The OPcache shared memory storage size.
opcache.memory_consumption=128
; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=64
//Edit
When I restart php-fpm, the message appears again a few hours later.