Skip to main content

What are the basic prerequisites to enable PHP opcache

Comments

10 comments

  • cPanelMichael
    Hello, The
    0
  • Kent Brockman
    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
  • Erel
    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
  • Kent Brockman
    @Erel: Do you know if there is anyway to use mpm_worker + OPCache + fcgid?
    0
  • Erel
    I don't know.
    0
  • cPanelMichael
    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
  • cPanelMichael
    ) 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
  • Kent Brockman
    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
  • cPanelMichael
    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.4
    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?

    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.