How to install APC on Linux server ?
The 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
extension=”apc.so”
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 http://pecl.php.net/package/APC and copy the download link
#wget http://pecl.php.net/get/APC-3.1.19.tgz
3) Extract the archive
#tar -xzf APC-3.1.19.tgz
cd APC-3.1.19
phpize
./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/local/bin/php-config
make
make install
4) Check the PHP file location by
# php -i | grep php.ini
5) Add the extension in php.ini
extension=”apc.so”
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!