EasyApache 4 All PHP Options + OpCache

Andrew W

Member
Apr 3, 2015
9
1
3
USA
cPanel Access Level
Root Administrator
Hello :)

I'm currently using the All PHP Options + OpCache build using EA 4.

This profile installs SuPHP from what I'm seeing atm. But isn't OpCache not compatible with SuPHP? Has this changed?

I originally wanted to test EA 4 because MPM ITK was available. The build I had in my mind was Apache 2.4 + DSO + Opcache + MPM ITK.

However, MPM ITK has it's own build without Opcache and Opcache has its own build with SuPHP.

Is Opcache now compatible with SuPHP?

I'm getting my information from slightly older documentation: PHP Extension: OPCache - EasyApache - cPanel Documentation

Thank you anyone who can help answer my questions :)
 

Andrew W

Member
Apr 3, 2015
9
1
3
USA
cPanel Access Level
Root Administrator
For anyone who stumbles across this I believe I found my answer.

The "All PHP Options + Opcache" profile build in Easy Apache does indeed install SuPHP, but uses mod_cgi as the system default

So Opcache should be compatible in that sense I believe, but when performing a search for the normal opcache code in /usr/local/lib/php.ini I found nothing. If anyone knows what's up with that please reply!

This was found using the command "/usr/local/cpanel/bin/rebuild_phpconf --current"

Output:

Code:
Available handlers:
        ea-php54: cgi suphp
        ea-php55: cgi suphp
        ea-php56: cgi suphp
Configured handlers:
        ea-php54: cgi
        ea-php55: cgi
        ea-php56: cgi   (system default)
Choosing the Add Handlers is not available via WHM through Easy Apache 4.

Manage PHP Handlers in EasyApache 4 - EasyApache 4 - cPanel Documentation
 
Feb 28, 2014
15
1
3
cPanel Access Level
Root Administrator
Hello :)

No opcache extension is currently compatible with suPHP.

Thank you.
Then why does the "All PHP Options + OpCache" option provided by cpanel install suPHP? Further, when I used that profile, the opcache extension for php wasn't even checked on. What is the recommended way in EasyApache 4 to install php with opcache?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,883
2,256
463
The following document provides additional information on Opcode cachers in EasyApache 4:

PHP Options - EasyApache 4 - cPanel Documentation

Warnings:
  • EasyApache 4 does not currently support any opcode cacher other than OPCache.
  • Opcode caching programs are not compatible with the suPHP or CGI PHP handlers. The caching program either does not function, or functions incorrectly.
  • The system does not automatically configure OPCache. If you do not manually configure OPCache after you install it, it will provide no benefits.
  • We strongly recommend the DSO PHP handler for the OPCache opcode cacher.
  • Do not install multiple PHP caching programs on the same system. Multiple opcode caching programs consume excessive memory and degrade system performance.
You can change your PHP handler to DSO via "WHM >> Software >> MultiPHP Manager" after building the profile.

Thank you.
 

gfxpixeldesigns

Registered
Jul 14, 2011
3
0
51
Its still not clear to me on how to setup OpCache using EA4.

I have compiled the "All PHP Options + OpCache" EA4 build and made sure my PHP handlers are set to CGI mode.

However the documentation states:

"Opcode caching programs are not compatible with the suPHP or CGI PHP handlers"

And i cant see any options to enable FCGI mode or any builds that support this handler.

The documentation also states that we must manually configure OpCache:

"The system does not automatically configure OpCache. If you do not manually configure OPCache after you install it, it will provide no benefits."

I checked the usual location "/usr/local/lib/php.ini" for the OpCache code but as Andrew noted above this code was not present. From what i remember in EA3 the code was there but commented out so all we had to do was uncomment it.

I did try adding the OpCache code manually but this only resulted in errors when starting php:

"Cannot load Zend OpCache - it was already loaded"

I also tried the same code using WHM > MultiPHP Editor with the same result.

So what exactly is the correct way to set up OpCache in EA4? The documentation is not clear and the previous documentation for EA3 is no longer valid.