Alternative PHP Cache Chinese full name is "optional PHP caching", is a component of pecl, can be used to cache and optimize the PHP code on the Web server, improve server performance. Can be installed separately from the PECL and can be checked by phpinfo () to see if the installation is correct.
APC can significantly accelerate the speed of PHP applications, the principle is to cache opcode PHP intermediate code, adding APC in the application can improve the response speed of the application, reduce server load.
Below we describe how to install APC.
1. First install the necessary packages
?
1 |
sudo apt-get install php-pear php5-dev apache2-threaded-dev
|
2. Install APC:
?
1 |
sudo pecl install apc-3.1.6
|
3. Create the configuration file/etc/php5/conf.d/apc.ini content as follows:
?
4. Restart Apache:
?
1 |
sudo /etc/init .d /apache2 restart
|
After Apache restarts, the APC section will be included in the php.ini, and you can see the output information in Phpinfo ():
The above describes the Ubuntu installation APC, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.