Step a: Login to your server as root.
Step b: Download the APC
wget https://pecl.php.net/package/APC
eg : wget https://pecl.php.net/get/APC-3.0.15.tgz
Step c: Extract it over to your server
tar -xzf APC-3.0.15.tgz
cd APC*
Step d: Check the PHP location by running the below command:
which php
Step e: Create the configuration files using the below command
Phpize
Stepf: Now the APC need to be compiled over the server :
./configure –enable-apc –enable-apc-mmap –with-apxs –with-php-config=/usr/local/bin/php-config
make
make install
Note : You must install the APC in the php.ini file
Step g: Below command would help you to find the php.ini over the server :
php -i | grep php.ini
Step h : Amend php.ini by adding APC extension, as stated below :
vi /usr/local/Zend/etc/php.ini
Step I : Add the following to the php.ini file
apc.shm_segments=1
apc.optimization=0
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1
Step J : Restart apache
service httpd restart