Operating System & Version
CENTOS 7.9
cPanel & WHM Version
96.0.9

DHarry

Member
Nov 9, 2016
14
1
3
Kansas City, Missouri
cPanel Access Level
Root Administrator
Hi!

I'm looking at including OPcache into my set up but I had a couple of questions before I do. Right now, I have php-fpm enabled and I'm on PHP 7.3.

One of my accounts has multiple addon domains and each site uses fairly similar code. Would OPcache cause an issue with caching the similar files?

Also, when making updates to my site, is it good practice to clear OPcache each time?
 

olGerva

Member
Nov 20, 2017
22
2
53
Italy
cPanel Access Level
Root Administrator
Good morning
I am adding to the post.
Can I know and understand why any changes made in the WHM dashboard with MultiPHP INI Editor in the different versions of PHP do not affect then on the client cpanel.
Let me explain, for example I set opcache.memory_consumption=256, but actually I find 128
I modified the file /opt/cpanel/ea-php72/root/etc/php.d/10-opcache.ini and actually I find the different opcache modifications.
I don't understand if it is necessary to modify it from both parts or it would be enough only the file 10-opcache.ini
thanks
 

olGerva

Member
Nov 20, 2017
22
2
53
Italy
cPanel Access Level
Root Administrator
Hello and thanks for the intervention
I am saying that I initially edited the opcahe configuration directly in the WHM dashboard.
Home " Software " MultiPHP INI Editor
This is for all installed versions of PHP.
But apparently the changes had no effect. For example I set opcache.memory_consumption=256, but I keep seeing 128
So I tried to edit individual files, for example at the following path
/opt/cpanel/ea-php72/root/etc/php.d/10-opcache.ini
also in this case for all versions of PHP.
In this case the changes have actually been applied.

The question is how to mail the changes in the php.ini file have no effect, but only those made to the 10-opcache.ini file

Which is the correct procedure?

I add, sorry but I'm not aware of this, can I have different configurations of opcache for different user panels or just one configuration for all.
Thanks
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
It sounds like there is something else happening as I would expect the changes you made in WHM to work normally. If you'd like to submit a ticket to our team we can check that for you on our end.

Yes, you can have different configurations for each user through their own local MultiPHP INI Editor tool that is available through cPanel, instead of the global option available through WHM.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Thanks for that - our team was able to look into this a bit more and gave the following details:

Code:
PHP allows settings to be changed in certain configuration files. For example:
 
https://www.php.net/manual/en/opcache.configuration.php
 
Here we can see that 'opcache.memory_consumption' has to be set in PHP_INI_SYSTEM. The '10-opcache.ini' file is what would be considered  PHP_INI_SYSTEM for OpCache. The PHP_INI_ALL option indicates a setting can be configured in any of the .ini files loaded by PHP (ie - .user.ini or php.ini).
 
It would be best to modify 10-opcache.ini for this particular setting. Regarding setting different memory for different cPanel accounts, that is better achieved by the memory_limit PHP setting.
 
I hope this information has been helpful. Please let us know if you have any additional questions or concerns.