Nextcloud : The PHP OPcache module is not properly configured

After updating Nextcloud to version 23, i get this on the admin-page of Nextcloud :

  • The PHP OPcache module is not properly configured:
  • The OPcache buffer is nearly full. To assure that all scripts can be hold in cache, it is recommended to apply opcache.memory_consumption to your PHP configuration with a value higher than 128 .

Where can i change this ?

F.

Haven’t tried but maybe it works by dropping a file with the setting:
creating file /etc/opt/rh/rh-php73/php-fpm.d/111-nextcloud.conf with content:

php_value[opcache.memory_consumption]  = 256

256 value is just an example.
or use a custom template instead…

You might need to restart the corresponding php service or apache web server.

But maybe the devs can consider to include it by default on the next rpm release (
for instance on /etc/opt/rh/rh-php73/php-fpm.d/000-nextcloud.conf file)

/cc @giacomo @stephdl

3 Likes

Just change the existing value in /etc/opt/rh/rh-php73/php-fpm.d/000-nextcloud.conf.
Ofcourse this wil not prevent the value to change again if updates are implemented.

Yes, you’re right. I didn’t look for the same parameter already present. :+1:

Thank you for the solution @dnutan

Well, that file is marked as config and will not be replaced on update: https://github.com/NethServer/nethserver-nextcloud/blob/master/nethserver-nextcloud.spec#L83

I’m ok also to change the configuration file to prevent the warning. Do you want to create a PR?
We could release on next Nextcloud update.

Hi Giacomo,

What is a PR ?
It seems to me that 000-nextcloud.conf should be templated.

F.

I get another warning on Nextcloud-admin - page :slight_smile:

  • The PHP OPcache module is not properly configured:
    • The maximum number of OPcache keys is nearly exceeded. To assure that all scripts can be hold in cache, it is recommended to apply opcache.max_accelerated_files to your PHP configuration with a value higher than 10000 .
    • The OPcache buffer is nearly full. To assure that all scripts can be hold in cache, it is recommended to apply opcache.memory_consumption to your PHP configuration with a value higher than 256 .
    • The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply opcache.interned_strings_buffer to your PHP configuration with a value higher than 8 .

PR means Pull Request

It’s not need for now.

I do not see such warnings on my production server. Maybe you have a very large installation? Maybe the warning is coming from some plugins?

2 Likes

will double check it this afternoon

I have this

The PHP OPcache module is not properly configured:

  • The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply opcache.interned_strings_buffer to your PHP configuration with a value higher than 8.

this is a PR

As a side note you can safely modify your configuration file manually , the rpm won’t modify it after an update

[root@prometheus ~]# rpm -qc nethserver-nextcloud
/etc/opt/rh/rh-php73/php-fpm.d/000-nextcloud.conf
/etc/sudoers.d/90_nethserver_nextcloud
/usr/share/nextcloud/.user.ini
1 Like

FYI :