To install APC, or Alternative PHP Cache, on your CentOS webserver, you should first install its dependencies:
yum install php-pear php-devel httpd-devel pcre-devel gcc make
Now, install APC with the use of PECL (or PHP Extension Community Library):
pecl install apc
Now it is installed, we should enable it in our Apache configuration file. To enable it, we edit our php.ini file:
echo "extension=apc.so" > /etc/php.d/apc.ini
We finalize the installation of APC on our Linux server running Apache by restarting the Apache daemon.
service httpd restart