Take the article page for example, through the chrome grab package, waiting time to reach 147ms, in fact, before caching optimization, this page has about 4 SQL statements, the speed is only about 152ms, the difference is not small, so I decided to install Zend Opcache accelerated PHP.
When I installed the Zend Opcache on the server, after testing, waiting has dropped to 68ms, the effect is obvious.
It is also necessary to install this type of PHP Accelerator for the So,laravel project.
Attached installation Tutorial:
The Zend Opcache (Zendoptimizerplus) project is currently hosted at GitHub, the project address is: Https://github.com/zendtech/ZendOptimizerPlus The installation steps are described in detail above, Here's a simple point:
1. Download
In the lower right corner of the project page there is a download Zip button, click it to download and upload to the server, you can also copy the link right, to the server through the wget download. 2.unzip decompression, access to directory
Copy Code code as follows:
CD Zendoptimizerplus-master
3. Installation
Copy Code code as follows:
$PHP _dir/bin/phpize
./configure--with-php-config= $PHP _dir/bin/php-config
Make && make install
Where $PHP _dir is your PHP installation directory, if you do not know, you can try
Copy Code code as follows:
Then ls-l get the path to find the installation directory of PHP, generally if it is compiled by source code, in/usr/local/php. It may also be installed through a Third-party Package manager, as long as you find Phpize and Php-config. When the compilation is complete, you get a hint:
Copy Code code as follows:
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
This is to tell you to compile the extension. so file location, and then we edit php.ini, this configuration file either in $php_dir/etc or in/usr/local/etc/and so on, in short, open it, add at the end
Copy Code code as follows:
[Zend Opcache]
opcache.memory_consumption=128
Opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
Opcache.revalidate_freq=60
Opcache.fast_shutdown=1
Opcache.enable_cli=1
Save exit, restart PHP-FPM or Apache.
The above is the entire content of this article, I hope you can enjoy.