As you know, PHP currently has three cache plug-ins: APC, Eaccelerator, XCache, but they may all disappear in the future, because PHP 5.5 has integrated Zend Opcache, features similar to the first three but slightly different, Cache speeds are said to be faster than they are (note: It is said that I have not tested it).
The main principles of these PHP acceleration plug-ins are the same, that is, to buffer the PHP data into memory to avoid duplication of the compilation process, the ability to directly use the buffer compiled code to improve speed, reduce server load, their efficiency is obvious, like Drupal this huge CMS, Each time you open a page to call dozens of PHP files, execute tens of thousands of lines of code, the efficiency can be imagined, after installing an APC and other accelerators, the speed of opening the page significantly faster.
Zend Opcache has been integrated in PHP 5.5, compile and install PHP5.5 when added--enable-opcache on the line. But also support the low version of PHP 5.2.*, 5.3.*, 5.4.*, the future will be canceled support for 5.2, below is my installation under PHP 5.4 method:
Execute the following command in turn
wget http://pecl.php.net/get/zendopcache-7.0.2.tgz tar xzf zendopcache-7.0.2.tgz cd zendopcache-7.0.2 phpize
If you can not find phpize, I find the PHP path, my/usr/local/php/bin/phpize, the following line will also be in accordance with your php.ini path to modify their own
./configure--with-php-config=/usr/local/php/bin/php-config Make do install
If installing shared extensions is displayed:/usr/local/php/lib/php/extensions/no-debug-zts-20100525/indicates that the installation is complete, Here to modify the PHP configuration file to make it effective
Add the following lines to the last side of the php.ini
Zend_extension=/usr/local/php/lib/php/extensions/no-debug-zts-20100525/opcache.so opcache.memory_consumption= Opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.revalidate_freq=60 Opcache.fast_ Shutdown=1 Opcache.enable_cli=1
128 means to allocate 128M memory to it, then reboot Apache and see if it takes effect with phpinfo.
Read someone else's article performance has 5~9% Ascension.
Reference article:
Http://www.tuicool.com/articles/yY7NRf
Http://www.searchtb.com/2014/02/apc-lock-php-fpm.html
Http://www.bo56.com/php%E7%9A%84-zend-opcache-vs-apc-%E6%80%A7%E8%83%BD%E6%AF%94%E8%BE%83/?spm=0.0.0.0.NEWthZ
PHP Accelerator plugin Zend Opcache