This article mainly introduces how to install endopcache accelerator in laravel. if you need it, refer to the following article page as an example. through chrome packet capture, the waiting time reaches 147 ms. before cache optimization, there are about four SQL statements on this page, and the speed is only about 15 2 ms, the difference is not big, so I decided to install zend opcache to accelerate php.
After I installed zend opcache on the server, I tested that waiting had dropped to 68 ms, and the effect was remarkable.
So, it is still necessary for the laravel project to install such php accelerators.
Attachment installation tutorial:
Zend opcache (ZendOptimizerPlus) project is currently hosted on github, the project address is: https://github.com/zendtech/ZendOptimizerPlus has been described in detail above the installation steps, here is a simple say it:
1. Download
In the lower-right corner of the project page, you can click the download zip button to download it and upload it to the server. you can also right-click the link and download it to the server through wget. 2. unzip and decompress the package to enter the directory.
The code is as follows:
Cd ZendOptimizerPlus-master
3. install
The code is as follows:
$ PHP_DIR/bin/phpize
./Configure -- with-php-config = $ PHP_DIR/bin/php-config
Make & make install
$ PHP_DIR is your php installation directory. if you do not know it, try
The code is as follows:
Which php
Then the path obtained by ls-l can find the php installation directory. generally, if it is compiled by source code. it may also be installed through a third-party package manager. you only need to find phpize and php-config. after compilation is complete, a prompt is displayed:
The code is as follows:
Installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
This is the compiled extension. so file location, then we edit php. ini. this configuration file is either in $ PHP_DIR/etc or in/usr/local/etc/or another place. In short, open it and add
The code is 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 and exit. restart php-fpm or apache.
The above is all the content of this article. I hope you will like it.