Replace APC with Zend OPcache

Turns out OPCache is a bit faster than APC so we decided to go ahead and make the change. In CentOS it can be found in the EPEL repo. First we want to remove apc:

Then we install Zend OPCache:

UPDATE:
I have switched to installing php54 and then you will have to install through PECL itself:

If you get an error about phpize you will need php54-devel as well:

And re-run the pecl command.

If it then complains about a C compiler (configure: error: no acceptable C compiler found in $PATH):

And re-run the pecl command again.

And restart PHP-FPM:

You can find a nice status page like apc.php here:
https://github.com/rlerdorf/opcache-status

For quick installation use the following command to download the php file to a directory of your choosing:

Here’s a screenshot of it on one of our test servers:
OPCache on PHP 5.3

Leave a Reply