Alternative PHP cache (APC)

Alternative PHP Cache (APC) is a PHP extension for caching data and compiled code from php accelerator. It helps to improve the performance of the webserver. The steps to install APC in cpanel are as follows:

# cd /usr/local/src
Get the latest version of APC,

# wget http://pecl.php.net/get/APC-3.0.14.tgz
# tar -zxvf APC-3.0.14.tgz
# cd APC-3.0.14

You can find the path of phpize and php-config using which command.

#which phpize
#/usr/local/bin/phpize
#which php-config
#/usr/local/bin/php-config

Now use these details to complete installation.

# /usr/local/bin/phpize
# ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/local/bin/php-config
# make
# make install

Add the following lines within the Dynamic Extensions section of php.ini as given below.

*********************
extension=apc.so
apc.shm_size = 32
;Windows Extensions
*********************

Restart httpd. Now you can see the apc section enabled in phpinfo() page.

NoteĀ :

After make install, you will get the extension path like this,

extension="/usr/local/lib/php/extensions/no-debug-non-zts-20020429/apc.so"

confirm whether extension directory is defined in php.ini.

extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20020429"

If not you should give the full path in php.ini instead of just ‘extension=apc.so’. Like this,

extension="/usr/local/lib/php/extensions/no-debug-non-zts-20020429/apc.so"


															
Both comments and pings are currently closed.

Comments are closed.