Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

What are the basic prerequisites to enable PHP opcache

Discussion in 'EasyApache' started by Kent Brockman, Aug 29, 2016.

Tags:
  1. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,178
    Likes Received:
    6
    Trophy Points:
    168
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    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:
    • 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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The https://documentation.cpanel.net/display/EA4/PHP+Options document notes the following warnings regarding OPcache:

    Also, note that it's unsupported with PHP version 5.4.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,178
    Likes Received:
    6
    Trophy Points:
    168
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Erel

    Erel Active Member

    Joined:
    Jul 23, 2007
    Messages:
    29
    Likes Received:
    2
    Trophy Points:
    53
    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
     
  5. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,178
    Likes Received:
    6
    Trophy Points:
    168
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    @Erel:
    Do you know if there is anyway to use mpm_worker + OPCache + fcgid?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Erel

    Erel Active Member

    Joined:
    Jul 23, 2007
    Messages:
    29
    Likes Received:
    2
    Trophy Points:
    53
    I don't know.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,178
    Likes Received:
    6
    Trophy Points:
    168
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    ok @cPanelMichael, it's frustrating but I started following the feature request and monitor page changes in the Current Status of EasyApache 4 - EasyApache 4 - cPanel Documentation and also in EA4 changelog to see when it is available. (for those also interested: you can monitor changes in webpages with this free webservice).


    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:
    • 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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    It's difficult to predict the performance results, as it varies based on individual server usage.

    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.

    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,178
    Likes Received:
    6
    Trophy Points:
    168
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    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?


    So, mod_cgid is completely unrelated to fcgid. Similar names but not similar functionality. Is this correct?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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

    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice