cPanel & WHM Version 94 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Add Zend OPcache on EasyApache for PHP 5.3 and 5.4

ikillbill shared this idea 7 years ago
Not Planned

As Zend OPcache is built in by default with PHP 5.5, I think it is the future of PHP caching!

Could you add Zend OPcache on EasyApache for PHP 5.3 and 5.4?

Best Answer
photo

The EasyApache team is gearing up to include OPcache support for PHP 5.5.


Please let us know what you think over at the PHP 5.5 feature request.

Comments (10)

photo
2

Zend Opcache is a in PECL. cPanel allows PECL modules to be installed but not Opcache because it's flaged as beta.


Please allow cPanel PECL module installer to install the PECL Zend Opache even if it's in beta.


http://www.php.net/manual/en/intro.opcache.php

photo
1

monarobase wrote:

Zend Opcache is a in PECL. cPanel allows PECL modules to be installed but not Opcache because it's flaged as beta.


Please allow cPanel PECL module installer to install the PECL Zend Opache even if it's in beta.


http://www.php.net/manual/en/intro.opcache.php

As a work around, you should be able to install alpha and beta PECL extensions via the command line.

photo
1

command line or whm PECL module installer?

photo
1

sonicthoughts wrote:

command line or whm PECL module installer?
Command line :

  1. pecl install ZendOpcache-beta

which should result in


  1. Build process completed successfully
  2. Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/opcache.so'
  3. install ok: channel://pecl.php.net/zendopcache-7.0.3
  4. Extension zendopcache enabled in php.ini

photo
1

One thing I forgot to mention is that if you subsequently run EasyApache it uninstalls your already installed beta pecl extensions. Great work cPanel :(

photo
1

Do you have to make any config/file changes to enable this after running the command?


pecl install ZendOpcache-beta


I'm already getting this error:


  1. root@server [~]# php -v
  2. Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory
  3. PHP 5.4.27 (cli) (built: May 1 2014 18:47:05)
  4. Copyright (c) 1997-2014 The PHP Group
  5. Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
  6. with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd., and
  7. with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies


  1. root@server [~]# ls -lh /usr/local/lib/php/extensions/no-debug-non-zts-20100525/opcache.so
  2. -rw-r--r-- 1 root root 523K May 9 16:00 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/opcache.so
  3. root@server [~]# ls -lh /usr/local/Zend/lib/Guard-6.0.0/php-5.4.x/ZendGuardLoader.so
  4. -rwxr-xr-x 1 root root 1.1M Apr 11 15:48 /usr/local/Zend/lib/Guard-6.0.0/php-5.4.x/ZendGuardLoader.so*

photo
1

If you edit the /usr/local/lib/php.ini so that the line that includes "opcache.so" explicitly lists the full path, then that error goes away. I am not sure why the installer doesn't take care of it correctly, but this workaround seems to work consistently.

photo
1

The EasyApache team is gearing up to include OPcache support for PHP 5.5.


Please let us know what you think over at the PHP 5.5 feature request.

photo
1

I have done this on a php 5.4 install. It works great but I am unable to reset the cache. It segfaults 11 apache and apache child processes. Memory is not an issue.

photo
1

Sorry still a bit confused. http://features.cpanel.net/responses/easyapache-zend-opcache-for-php-55 says that this is "completed" but it also says that it is NOT part of easyapache and not clear on support. This discussion is for Easyapache support. Do we need another feature request for opcache + Easeyapache? If not, then I do not think this should be marked complete (until it is a native option and supported.) Would you guys agree?

photo
1

Support for Zend Opcache in PHP 5.5, and 5.6, was added as part of EasyApache 3.30 (see change log: http://documentation.cpanel.net/display/EA/EasyApache+Change+Log).


Right now we do not provide support for Zend Opcache in versions of PHP older than 5.5.

photo
1

The changelog is confusing because it says "Add optmod for OPCache". As far as I know, usually "optmod" has been used to describe Custom Modules, the unsupported add-ins for EasyApache described here: https://documentation.cpanel.net/display/EA/Custom+Modules and OPCache is not listed there. I did eventually find the EA entry for opcache for php 5.5 in the Exhaustive Options list in the php section (though it took me a little longer since I was looking for Z for Zend), but I think the changelog could be clearer. That being said, now that I have found it, I am very glad it has been added directly instead of a custom module. :-)


I also have a question, is the reason for not supporting it in older php because it hasn't been started yet, because it is vaguely straightforward enough to install via pecl and thus maybe not needed in EA itself, because these php versions are old and even 5.4 might soon be unsupported so adding new modules for them would be time better spent elsewhere, or some specific reason for Zend Opcache in particular being harder or less desired with those php versions? (Or some other reason I didn't think of yet.)

photo
1

Since PHP 5.3 and 5.4 are not supported in EasyApache 4, and EasyApache 3 is currently deprecated, I've marked this as not planned. If you have any questions, feel free to reach out!

Replies have been locked on this page!