How to install and configure APC cache on a cPanel server?

For a plain Linux server, follow: How to install APC cache on a Linux server?

Installation of APC cache on a cPanel server is pretty easy. Follow the below steps to install APC cache on cPanel server:

1. SSH to the server and execute:

# yum install pcre-devel

2. Goto WHM –> PHP Configuration Editor –> Advanced Mode, change theĀ  “extension_dir” value from

/usr/local/lib/php/extensions/no-debug-non-zts-20060613
to
/usr/lib/php/extensions/no-debug-non-zts-20060613

3. Install APC cache from WHM.

WHM --> Module Installers --> click Manage next to "PHP Pecl".
Search APC and install it.

4. Change PHP Handler to DSO. You can either do this from WHM OR via SSH:

WHM --> Service Configuration --> Apache Configuration -->
Configure PHP and SuExec --> PHP5 Handler
OR
# /usr/local/cpanel/bin/rebuild_phpconf 5 0 dso 1

Once done, make sure apc.so file is present in the /usr/lib/php/extensions/no-debug-non-zts-20060613 directory. Sometimes it is created in the original directory and you have to create a symlink.

# ln -s /usr/local/lib/php/extensions/no-debug-non-zts-20060613/apc.so \
 /usr/lib/php/extensions/no-debug-non-zts-20060613/apc.so

Restart the Apache webserver and to confirm if APC is activated, execute:

# php -i | grep apc
This entry was posted on Wednesday, July 25th, 2012 and is filed under cPanel Management. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.