APC cache is a PHP caching solution which stands for Alternative PHP Cache. It serves PHP pages from a cache thus helping to reduce server load. APC is an open source software and is updated from time to time.
The following are the steps to install APC cache on a cPanel / Plesk OR even on a plan CentOS server:
1) SSH to your server and go to a temporary directory
# cd /usr/local/src
2) Download the latest APC version
# wget http://pecl.php.net/get/APC-3.1.6.tgz
3) Unpack the version and change to the APC directory
# tar -zxf APC-3.1.6.tgz# cd APC-*
4) Create configuration files
5) Search for the “php-config” file since you need to configure APC with it
# which php-config
6) Now, configure APC
# ./configure --enable-apc --enable-apc-mmap --with-apxs\ --with-php-config=/usr/local/bin/php-config
7) Create the installation files and install APC
# make# make install
Now that the APC cache is installed on your server, the final step is to activate the APC extension in the php.ini file.
Locate the working php.ini file of your server
# php -i | grep php.ini
edit the file and search for “extension_dir” and place the following code below it (tweak the values as per your requirement):
Restart the Apache web server for changes to take affect. To confirm if APC is activated, execute
# php -i | grep apc
Note: once APC is installed, make sure the ‘apc.so’ file is created under the directory specified at the “extension_dir” in php.ini. If not, look for the exact path of the file and create a symlink under it.