Skip to main content

PHP-FPM and excluding files from opcache

Comments

8 comments

  • cPanelMichael
    Hello @APatchworkBoy, The OPCache extension uses it's own .ini file at: /opt/cpanel/ea-php71/root/etc/php.d/10-opcache.ini This is the file you should edit if you want to modify the default global OPcache PHP settings for PHP 7.1. Upon making the changes, ensure to run the following commands: /scripts/restartsrv_apache_php_fpm /scripts/restartsrv_httpd
    The following resource is also available if you'd like to read more about managing php.ini directives with PHP-FPM on a per-account basis or exclusively for domains using PHP-FPM:
    0
  • APatchworkBoy
    Thanks @cPanelMichael !
    0
  • ronaldst
    I've run into a problem with OPCache for one of my users (running WordPress). He uses a well-known (and reputable) plugin which has stopped working properly after OPCache was turned on. I need to activate some sort of OPCache blacklist for his account and/or domain. Server is running Apache, PHP-FPM & OPcache. How do I best approach this? Can a user edit his PHP-configuration in cPanel (or .htaccess) and achieve this by himself? Do I need to configure a blacklist in the domain .yaml-file for the domain? Or is the only option to edit the global configuration for OPCache in ea-php7x/root/etc/php.d/10-opcache.ini? I would love if someone would be kind and provide some best practice insights on this and an example. Thank you.
    0
  • ronaldst
    Anyone able to chime in on this thread? Is it possible to define a user-specific blacklist for OPCache or is the global one the only option?
    0
  • cPanelMichael
    Hello @ronaldst, I merged your thread here, as you noted using PHP-FPM. Can you confirm if the information in this thread helps? Thank you.
    0
  • ronaldst
    Thank you @cPanelMichael I'm aware how to make a global blacklist in OPCache (as described in this post). However, what I'm asking is if it is possible to add a blacklist in OPCache for a specific user and/or domain. Is this something the user can manage by himself from cPanel? I want to avoid adjusting the global configuration for every user with specific needs, if possible. My apologies if this wasn't clear in my first post. Can a regular (cPanel) user manage his own OPCache blacklist, either by using the PHP-configuration options provided in cPanel or by .htaccess? If so, how? If not, can this be done by (me) editing/adding a blacklist in the .yaml-file for this specific user/domain? .. or should I go ahead and edit the global configuration for OPCache (as this is the only solution)? Thank you.
    0
  • ronaldst
    Anyone able to chime in on this? @cPanelMichael A thread marked as SOLVED gives little to no chance for a reply.
    0
  • cPanelMichael
    Hello @ronaldst, You can review how changeable each OPCache option is on the PHP document below: Thank you.
    0

Please sign in to leave a comment.