Since 5.5, PHP comes with a built-in OPcache system. This PHP accelerator has been open sourced by Zend and is a good replacement for APC.
If you installed PHP 5.6 on your Mac with Homebrew, you maybe noticed that OPcache is not enabled by default. Even if the extension has been compiled, a manual configuration must be done to enable the extension.
- Open
/usr/local/etc/php/5.6/php.ini
- Add
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/opcache.so
at the end of this file - Restart your PHP FPM or Apache if you are using mod_php
You’re dev environment is now blazing fast!
Thanks !
(Works for php 5.6 btw)
You need to install the php-opcache package for some time now (since OS X 10.11 El Capitan I think): brew install
Then you need to enable it in the opcache section of your php.ini: opcache.enable=1
Finally, restart your PHP-FPM or your Apache.
Oops, my previous comment has been escaped: brew install php55-opcache or brew install php56-opcache.
first install php-opcache,