How to install APC on Linux server ?

php logoThe Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.

No external libraries are needed to build this extension.

There are two ways of installing APC on Linux server.

Let us discuss both of them in brief


Steps to install APC using PECL

The APC can be installed using PECL on linux cpanel server

1) Just execute following command from shell as root user

pecl install apc

and select the options  as per the requirement.

2) Update global php.ini with the apc extension


3) Restart apache service

Steps to install APC on Linux server manually using tarball

1) Login to the server as root from shell and go to

#cd /usr/local/src

2) Go to and copy the download link


3) Extract the archive

#tar -xzf APC-3.1.19.tgz

cd APC-3.1.19


./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/local/bin/php-config


make install

4) Check the PHP file location by

# php -i | grep php.ini

5) Add the extension in php.ini


6) Restart Apache

7) Check the PHP modules

Note: If  the OS is Centos 5.5 then install pcre module if not present

# yum install pcre-devel

 If any feedback, queries are always welcome!

Share on Facebook0Share on Google+0Tweet about this on TwitterShare on StumbleUpon0Share on LinkedIn0Share on Tumblr0Pin on Pinterest0Email this to someonePrint this page

About Abhijit Sandhan

Abhijit Sandhan
Loves Linux, Blogging, Traveling, Hiking and sharing Knowledge!

Leave a Reply

Your email address will not be published. Required fields are marked *