APC is a Alternative PHP Cache which is a caching solution for PHP.

How APC works ?

APC reads your PHP files, parses them into a more efficient binary format and then caches them in memory so that each request for your PHP files and PHP library files can be fed from the parsed cache. This will generally lead to a speed increase when serving a PHP site, especially one with a lot of library files.

Installing APC

1) ssh the server with root user and download apc package.

HTML Code:
# cd /usr/local/src
# wget http://pecl.php.net/get/APC-3.1.6.tgz
2) Unpack the version and change to the APC directory

HTML Code:
# tar -zxf APC-3.1.6.tgz
# cd APC-3.1.6.tgz
3) Create configuration files and search for the “php-config” file since you will need to configure APC with it.

HTML Code:
# phpize
# which php-config
4) Now, configure APC

HTML Code:
./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/local/bin/php-config
5) Create the installation files and install APC

HTML Code:
# make
# make install
Now AP installation is completed. Last step is to ad apc extension to php.ini file

6) search for php.ini file

HTML Code:
# php -i | grep php.ini
7) Adding extension

HTML Code:
extension="apc.so"
apc.enabled=1
apc.shm_segments=1
apc.shm_size=256
apc.ttl=3600
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXx
apc.enable_cli=1

8) Save the file and restart apache service.

HTML Code:
#/etc/init.d/httpd restart
9) Now you should see apc extension available under phpinfo.