Thursday, June 13, 2013

Installing APC (Alternate PHP Cache) on CentOS / Redhat


First we need the pecl command to install apc.

run the following command

yum install php-pear

And we need the following command for phpize command

yum install php-devel

We also need to run the following command to enable apxs command

yum install httpd-devel

And then run the following command

yum install pcre-devel

For Debian User

aptitude install libpcre3-dev


And then finally run the pecl install command

pecl install apc


Once finishes, we need to enable apc in apache configuration, run the following command to include extension into php.ini

echo "extension=apc.so" > /etc/php.d/apc.ini


Then restart the apache

service httpd restart

That's it. Now enjoy and watch for less execution time compared to before.