OPCache configured !?

Nextcloud 30.0.2
Linux Debian

I’ve got the following error and I can’t find the solution even after reading helping file online … because of my not so good english

Citation
Le module PHP OPcache n’est pas correctement configuré. Le tampon mémoire des chaînes internes OPcache est presque plein. Pour vous assurer que les chaînes répétitives peuvent être mise en cache, il est recommandé de définir la variable “opcache.interned_strings_buffer” de votre fichier de configuration PHP à une valeur supérieure à “8”
english ------------------------------------------------------------------
OPcache PHP module not correctly configured. The memory buffer for OPcache internal strings is almost full. To ensure that repetitive strings can be cached, we recommend setting the “opcache.interned_strings_buffer” variable in your PHP configuration file to a value greater than “8”."

Could you please help me ?
Mant thanks in advance.

I have set opcache.interned_strings_buffer=16
to get rid of the issue.

My tutorial, PHP settings section with OPcache

My PHP version is 8.2 and my tree is
/etc/php/8.2/cli/php.ini

My “opcache.interned_strings_buffer” is already = 16

I used these elements https://docs.nextcloud.com/server/30/admin_manual/installation/server_tuning.html#enable-php-opcache
but I always get the same warning

OPcache PHP module not correctly configured. The memory buffer for OPcache internal strings is almost full. To ensure that repetitive strings can be cached, we recommend setting the “opcache.interned_strings_buffer” variable in your PHP configuration file to a value greater than “8”."

That is the php.ini from your cli SAPI. So that one only has effect for cron jobs and occ commands.

You should know, which php-SAPI is used by your webserver.

SAPI stands for “Server API” (API stands for “Application Programming Interface”). It is the mechanism that controls the interaction between the “outside world” and the PHP/Zend engine.

These are the most important SAPIs:

Command Line Interface

  • term - cli
  • package - php<VER>-cli
  • description:
    cli is used by PHP scripts that are called from the command line. i.e. all processes that were explicitly NOT called by the web server (cron jobs, occ commands, etc.)

Apache2 module (a.k.a. Apache2 Handler)

  • term - apache2
  • package - libapache2-mod-php<VER>
  • description:
    the apache2 module is the default SAPI for apache2. The downside is that it’s not particularly scalable and doesn’t support http2.
    libapache2-mod-php relies on the old but stable Multi-Processing Module (MPM) “mpm-prefork”.

Fast Process Manager

  • term - fpm
  • package - php<VER>-fpm
  • description:
    this is the default SAPI used by nginx.
    On apache2 php-fpm relies on the more scalable threaded MPM “mpm-event”. Additionally it needs the apache2-modules “proxy_fcgi” and “setenvif”.

Every SAPI has its own php.ini file:

  /etc/php/<VER>/<SAPI>/php.ini

If your webserver is apache2, you can find out the active mpm (Multi Processing Module) with this command call:

sudo apachectl -M 2>/dev/null | grep mpm

as explained above, the “mpm_event_module” means that apache2 speaks via fpm, while the “mpm_prefork_module” indicates that the apache2 module is used for the comunication between webserver and php.
Since only one mpm module can be loaded in the core of apache2, libapache2-mod-php<VER> and php<VER>-fpm are mutually exclusive.
You should know which of both is used to tweek the right php.ini file.


So if your webserver uses the apache2 handler, then you should tweek:

  /etc/php/8.2/apache2/php.ini

while if your web server uses the Fast Process Manager, then you need to look here:

  /etc/php/8.2/fpm/php.ini

h.t.h


Bon chance,
ernolf

5 Likes

In addition to what @ernolf said, 16 may still not be enough. I have set mine to 64. But there is no one fits them all value, so you might have to test it. Start with 16 and then incremet it as needed, until the warning doesn’t appear anymore.

1 Like

My webserver is Apache2 so I put 16 in

/etc/php/8.2/apache2/php.ini
and everything is now well = No more warning.

Many many thanks you 3 ;o)

3 Likes

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.