Php5.3LNMP integrated environment install opcache you know that there are currently three PHP Cache plug-ins: APC, eAccelerator, and XCache, but they may disappear in the future, because PHP 5.5 has already integrated Zend Opcache, features are similar to those of the first three, but they are a little different. the cache speed is said to be faster than them.
The main principles of these PHP acceleration plug-ins are the same. they are to buffer the executed PHP data into the memory to avoid repeated compilation processes, you can directly use the compiled code in the buffer zone to increase the speed and reduce the server load. their efficiency is obvious, such as the huge CMS such as drupal, each time you open a page, you need to call dozens of PHP files and execute tens of thousands of lines of code. the efficiency can be imagined. after installing the APC and other accelerators, the page opening speed is significantly faster.
The following describes how to install opcache in the LNMP environment of your virtual machine.
Wget https://pecl.php.net/get/zendopcache-7.0.4.tgztar zxvf zendopcache-7.0.4.tgzcd zendopcache-7.0.4./configure -- with-php-config =/usr/local/php/bin/php-configmakemake install
Then modify php. ini.
Vim/usr/local/php/etc/php. add the following content to ini: zend_extension =/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/opcache. soopcache. memory_consumption = 128opcache. interned_strings_buffer = 8opcache. max_accelerated_files = 4000opcache. revalidate_freq = 60opcache. fast_shutdown = 1opcache. enable_cli = 1
Restart php-fpm. /Etc/init. d/php-fpm restart