OPcache and Addon Domains
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?
-
Hey there! Opcache will handle those files just fine. Clearing the cache is completely up to you, but it's definitely not required. You'll want to be aware of the PHP handlers on the machine when adding opcache, as outlined here: Can I use opcache with suphp? 0 -
@cPRex - Thank you! I couldn't find a definite answer anywhere so I appreciate your help here. 0 -
Sure thing! 0 -
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 -1 -
@olGerva - can you provide me with some more details on this? Are you saying after you edit the configuration file, on the command line, you are not seeing this change in the cPanel interface for users assigned that specific PHP version? 0 -
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 0 -
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. 0 -
OK done. Thanks 0 -
Can you post the ticket number here so I can follow along? 0 -
94411540 Thx 0 -
Thanks for that - our team was able to look into this a bit more and gave the following details: 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.0 -
Hi Yes extremely kind and prepared. They have answered any doubts I had Thank you very much great experience 0
Please sign in to leave a comment.
Comments
12 comments