Paper Lantern for cPanel accounts is being retired this year. Find out more »
cPanel & WHM Version 102 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!
This object is in archive! 

EasyApache: Zend Opcache for PHP 5.5

cPDavidNielson shared this idea 9 years ago
Completed

Zend Opcache is included in the source tree for PHP 5.5, but it is not enabled by default, and is not exposed in EasyApache. This is a compelling new feature, and important for performance reasons, since eAccelerator and Xcache are no longer available with PHP 5.5.

Best Answer
photo

Hi everyone,


Thanks for all your interest in Opcache. Thanks to Neso for providing the line to enable Opcache. EasyApache is planning on enabling Opcache by default in the near future. Please watch the feature request and our EasyApache change log for updates.

Replies (17)

photo
4

For everybody that wish to activate OPcache, you need just to add one line to your php.ini file:


In my case this was:


zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20121212/opcache.so


Also under that line you can add these configuration settings if you wish to increase memory etc.


opcache.memory_consumption=256

opcache.interned_strings_buffer=8

opcache.max_accelerated_files=4000

opcache.revalidate_freq=60

opcache.fast_shutdown=1

opcache.enable_cli=1

opcache.enable=1


And one more thing, if you wish to track memory usage etc.


You can use this: https://gist.github.com/ck-on/4959032/?ocp.php

photo
1

it works ;)

photo
1

Thank you very much, Neso.

photo
1

What about it built in?

Can it be implemented in a easier manner?

Thanks cPanel,

photo
1

Hi everyone,


Thanks for all your interest in Opcache. Thanks to Neso for providing the line to enable Opcache. EasyApache is planning on enabling Opcache by default in the near future. Please watch the feature request and our EasyApache change log for updates.

photo
1

OK, I installed it according to the instructions here — and it does make a noticeable improvement on our sites — does a new EasyApache install delete it? How can we protect it?


Once you add it to EasyApache, does that replace this installation and settings or what?


Peace,

Gene

photo
2

Hi Gene,


Perform these steps to enable the Zend OPcache extension in PHP when using EasyApache:


1. Create the file, /var/cpanel/easy/apache/rawopts/all_php5, that contains the following text: --enable-opcache

( NOTE: Each option passed to PHP needs to be on its own line. If this file already exists, then place this text at the end of the file, on its own line. )


2. Run EasyApache


3. Once you've successfully built your web stack using EasyApache, enable and configure OPcache by editing /usr/local/lib/php.ini with settings that suit your server's needs.


4. Restart your webserver: /usr/local/cpanel/scripts/restartsrv_httpd


5. If you want to verify that OPcache is enabled under Apache, then create a PHP page that executes the phpinfo() function. Search for the "Zend OPcache" phrase.


6. Remove the temporary PHP page after you've verified.


Performing these steps ensures that OPcache remains enabled when running EasyApache. Refer to PHP's OPcache documentation to learn more about configuring Zend Opcache.

photo
1

Hi,


Does this still work?

=> Create the file, /var/cpanel/easy/apache/rawopts/all_php5, that contains the following text: --enable-opcache

I tried that but it didn't work. The content of all_php5:

--enable-fastcgi

--enable-fpm

--enable-opcache


Thanks!

photo
1

At least provide direct support as experimental or have an official how to guide. Unless you follow specific Cpanel guidelines the next update will break this, overwrite or remain custom config ...

photo
2

Have any plan when its will be done ?

photo
1

@ Scott.


We are still waiting....


Could you please define "near future". Easy Apache has been updated 15 times since you wrote on this feature request. I think 7 months is a bit long time for such a simple thing. It's not that big fix, this feature request is about.


Regards

Bastian Jorgensen

photo
1

Yeah a built in way on EA4 to turn on and off this feature would be great!


Thank you.

photo
1

I just did an installation like explained before, it worked but I had to change my PHP Loader from suphp to fcgi.


With suphp opcache was started at every request and the cached files weren't preserved.


Hope this helps someone.

photo
1

Does this mean we need to open ANOTHER feature request to actually include as part of EasyApache? Please advise - Until it is IMO this feature is not complete. thx."Zend Opcache is included in the source tree for PHP 5.5, but it is not enabled by default, and is not exposed in EasyApache. "

photo
1

I see in the changelog at https://documentation.cpanel.net/display/EA/EasyApache+Change+Log that there is now an optmod to install zend opcache, but I do not see it in the list at https://documentation.cpanel.net/display/EA/Custom+Modules .

photo
1

Until this is in EASYAPACHE and fully supported, it should not be marked completed!

photo
1

Oh wait I found it! I'm not sure why the changelog calls it an Opt Mod though. It's in "Exhaustive Options List" in the php section and is just called "Opcache".

Replies have been locked on this page!