How To Install and Enable Alternative PHP Cache (APC) on CentOS

Install Alternative PHP Cache (APC) on CentOS

In this tutorial we will show you how to install and configuration of Alternative PHP Cache (APC) on your CentOS server. For those of you who didn’t know, The Alternative PHP Cache (APC) is a free, open, and robust framework for caching and optimizing PHP intermediate code. It’s an PECL extension which shares the packaging and distribution system with its sister, PEAR. In this post, i will show how to enable APC (Alternative PHP Cache) and makes PHP be fast.

Install Alternative PHP Cache (APC) on CentOS

Step 1. Install dependencies.

Step 2. Installing Alternative PHP Cache (APC) on CentOS.

Step 3. Configuring APC.

You can put your configuration in php.ini file but i prefer to have separate file like above for configuration. Values mentioned below are for demonstration purpose, different values  for APC can be set  which depends on number of PHP pages, size of memory in server, number of page hits e.t.c

Step 4. Enable APC PHP Extension

Once that finishes, run the following command to enable APC extension in Apache configuration.

Step 4. Restrat Nginx

APC provides a web interface with detailed information on the cache (memory usage, hits and misses, cache entries). By default it is not accessible so you need to copy the file /usr/share/php/apc.php to somewhere you can browse to. Now from browser, you can go to I prefer to wait for a day to see the APC performance so we can have clear idea how well our configuration did.

Install Alternative PHP Cache (APC) on CentOS

Congratulation’s! You have successfully installed Alternative PHP Cache (APC). Thanks for using this tutorial for installing Alternative PHP Cache (APC) on CentOS system. For additional help or useful information, we recommend you to check the official PHP web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “Nginx Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!