DotNux – Unix/Linux Technical Mini Howto

August 15, 2009

How to install PHP accelerator (APC) on Centos 5

Filed under: Uncategorized — admin @ 11:11 am

If you used PHP on Apache, whether on Centos, Gentoo, Ubuntu, etc., you probably noticed PHP gets slower as most modern PHP framework gets bigger in sizes, more layers, increasing database records, etc.

Then, try to install FREE php accelerator called APC (Alternative PHP Cache).
APC is a free, open, and robust framework for caching and optimizing PHP intermediate code.
In other words, APC will compile PHP code automatically, and can give a boost to your site without modification, 2, 5, 10 and perhaps even more performance boost.

One time I had mediawiki, and it was getting really slow, and after installing APC, it’s about 5 times faster.

Let’s get down to the detail:


yum install php-pear
yum install php-devel
yum install httpd-devel
perc install apc
echo "extension=apc.so" > /etc/php.d/apc.ini


and then restart apache!


/etc/init.d/httpd restart

Confirm the output of phpinfo() that APC works (look for APC block)

Powered by WordPress