What are the basic prerequisites to enable PHP opcache
Hello guys. I'm trying to enable a server to use PHP opcache as I did in other EA4 installs, but is not installing it.
I discovered after repeated compilations and trial and error, that to enable opcache, EA4 requires to precompile the system including:
[LIST]
Apache MPM: mpm_worker
Apache modules: mod_suphp + mod_suexec + mod_cgid + mod_proxy_fcgi
PHP modules: php_build + php_devel + php_runtime + php-fpm + php-opcache + php-zendguard (?)
In some servers this combination made the trick, but there is one of them not obbeying and opcache is not being included in phpinfo reports :(
Can you confirm if this is ok or may I be missing something important?
Best regards
-
Hello @cPanelMichael, thanks for answering. I'm already aware of all these recomendations. I was trying to enable OPCache under PHP 5.6.25, with Apache 2.4 using mpm_worker and the modules I listed above, which are theoretically compatible with it. In fact, I cloned one of the default templates that are currently shipped with cPanel, which already include OPCache, but it just don't integrate the OPCache PHP module when provisioning, it just ignores the request to do that. I also tried to find the DSO Apache module but it's not present in the list of options. So, should I open a ticket? or may this be a EA4 bug? 0 -
I was able to install OPCache with PHP 7.0. It was more complicated than I expected. I listed the modules that I installed here: EasyApache4: Definitely Worth It 0 -
@Erel: Do you know if there is anyway to use mpm_worker + OPCache + fcgid? 0 -
I don't know. 0 -
Do you know if there is anyway to use mpm_worker + OPCache + fcgid?
FastCGI is unsupported in EasyApache 4 at this time. You can follow this feature request to receive updates on when it's supported: EasyApache 4 mod_fcgid Note you may also find the following document helpful, as it's been updated to reflect some of the existing issues with EasyApache 4: Current Status of EasyApache 4 - EasyApache 4 - cPanel Documentation Thank you.0 -
ok @cPanelMichael, it's frustrating but I started following the feature request and monitor page changes in the ). Well now I have 3 more questions: 1) As per the performance solution, what would you recommend to reach the best possible speed without fcgi in crowded servers (+200 accounts)? Maybe mod_cgi + PHP opcache + apache mpm_worker? 2) If fcgi is not supported, why are these modules present in the EA4 options: [LIST] - ea-apache24-mod_cgid
- ea-apache24-mod_proxy_fcgi
- ea-php55-php-fpm
- ea-php56-php-fpm
- ea-php70-php-fpm 3) What's the difference between ea-apache24-mod_cgid and ea-apache24-mod_cgi? Thanks
0 -
) As per the performance solution, what would you recommend to reach the best possible speed without fcgi in crowded servers (+200 accounts)? Maybe mod_cgi + PHP opcache + apache mpm_worker?
It's difficult to predict the performance results, as it varies based on individual server usage.) If fcgi is not supported, why are these modules present in the EA4 options: [LIST]
- ea-apache24-mod_cgid
- ea-apache24-mod_proxy_fcgi
- ea-php55-php-fpm
- ea-php56-php-fpm
- ea-php70-php-fpm
Those packages were present to allow users to follow instructions from the "Configure PHP-FPM with User Pools for EasyApache 4" document. While it's still possible to follow those instructions, it's highly discouraged. The instructions from that document are not compatible with the actual FPM support in cPanel version 60.) What's the difference between ea-apache24-mod_cgid and ea-apache24-mod_cgi?
Both are available, depending on the selected MPM. Threaded MPMs (Event and Worker) work with mod_cgid. Prefork, the only forking MPM, uses mod_cgi. Thank you.0 -
Ok, thanks for the clarifications. So, usage of *-php-fpm modules is officially discouraged? Still, using opcache seems to be the closest approach to a PHP optimization by now. Is this correct? Both are available, depending on the selected MPM. Threaded MPMs (Event and Worker) work with mod_cgid. Prefork, the only forking MPM, uses mod_cgi.
So, mod_cgid is completely unrelated to fcgid. Similar names but not similar functionality. Is this correct?0 -
So, mod_cgid is completely unrelated to fcgid. Similar names but not similar functionality. Is this correct?
That's correct. Here's documentation on both: mod_fcgid - FastCGI interface module for Apache 2 - The Apache HTTP Server Project mod_cgid - Apache HTTP Server Version 2.4So, usage of *-php-fpm modules is officially discouraged? Still, using opcache seems to be the closest approach to a PHP optimization by now. Is this correct?
Yes, the use of those RPMs is discouraged until cPanel version 60. Also, yes, EasyApache 4 does not currently support any opcode cacher other than OPCache. Thanks!0
Please sign in to leave a comment.
Comments
10 comments