How to Install APC on Linux Server?

The Alternative PHP Cache (APC) is well known free and open opcode cache for PHP. APC plays an important goal in providing a free, open, and robust framework for caching and optimizing PHP intermediate code.

From pecl you can download latest APC.

# cd /usr/local/src/
# wget http://pecl.php.net/get/APC

After Extract the downloaded APC which will be in zip format and compile it.

# tar -xvf APC
# cd APC-*
# phpize
# ./configure
# make && make install

Now, on your server you will have to enable the extension in php.ini . The command as given below will give you the exact server’s php.ini

# php -i | grep php.ini

Add “extension=apc.so” & restart apache.

Use the command below, to check if it is compiled properly OR create a phpinfo & check the output.

# php -i | grep apc