Because Linux is not familiar, resulting in a simple installation process encountered a lot of problems, fortunately, the final installation is successful, the memo is written here.
the main principles of Zendopcache :
PHP after the data buffer into memory to avoid duplication, can directly use the buffer compiled code to improve speed, reduce server load, their efficiency is obvious, like Drupal this huge CMS, every time you open a page to call dozens of PHP files, execute tens of thousands of lines of code, Efficiency is conceivable, after installing an APC and other accelerators, the speed of opening the page is significantly faster.
php5.5 above the official default installation, php5.2-5.4 is currently supported, you can download the installation yourself.
My server is using the php5.3.
Official website
Http://pecl.php.net/package/ZendOpcache
Installation process:
wget http://pecl.php.net/get/zendopcache-7.0.3.tgztar xzf zendopcache-7.0. 3 . TGZCD Zendopcache-7.0. 3
At this point to confirm a few software we have installed:
Gcc:
GCC is the short name of the gun Compiler collection, in addition to the compiler, it also contains other related tools, so it can be easily human-use high-level language written by the code to build the computer can directly execute the binary code. GCC is the most commonly used compiler for Linux platforms, and it is the de facto standard for Linux platform compilers. At the same time, in the field of embedded development under the Linux platform, GCC is also the most common type of compiler.
Installation method:
Yum Install GCC
Phpize
The phpize command is used to prepare the compilation environment for the PHP Extension library. Simply put, the opcache.so we are about to compile is placed in the PHP modules directory. All we have to do is run the phpize before make .
Installation method:
Yum Install Php-devel
Ready to determine the location of several files:
whereis phpwhereis php-config or which phpwhich php-config
Then execute the following command:
phpize. /configure--with-php-config=/usr/bin/bin/php-configmakemake Install
displaying: Installing Shared extensions:
That means success.
The next step is to modify the php.ini to take effect.
Find php.ini Location:whereis php.ini
vi/etc/php.ini Write zend_extension=/usr/php/lib/extensions/opcache.soopcache.memory_consumption =opcache.interned_strings_buffer=8opcache.max_accelerated_files= 4000 opcache.revalidate_freq=opcache.fast_shutdown=1opcache.enable_cli =1
Restart Apache
Httpd-k restart
View Phpinfo, if a with Zend Opcache v7.0.3, Copyright (c), the installation is successful.
Can write a file casually echo 111, test, all scripts are loaded into memory, the default 2 minutes update.
CentOS Installation Zendopcache