Install APC on Ubuntu 12.04

APC (alternative page cache) is an addon to php to increase execution time of PHP scripts. To do so APC caches previously compiled bytecode of PHP code which can be reused in later page requests. The install on Debian/Ubuntu based Linux distributions (in my case Ubuntu 12.04) is quite simple.

 

sudo apt-get install php-apc
sudo service apache2 restart

 After install you should download the apc.php from the pecl repository The following line will download apc.php from version 3.1.10:

 

Upload this file to your webserver root. By calling the script you get a statistical representation of your memory used for APC. If your running a website which consumes a lot of memory, APC will unluckily fragment your memory cache a lot. Also the value Cache full count will increase. In that case you should increase the memory limit until it fits your needs by adding the following line to the apc configuration file apc.ini which can be found in /etc/php5/conf.d :

apc.shm_size=64

 Thats it!

你可能感兴趣的:(ubuntu 12.04)