How to Install APC on cPanel

If you run a popular website on a cPanel hosting account, you may begin to encounter performance issues during traffic spikes. If your website is written in PHP, one solution to enhancing system performance is to install the Alternative PHP Cache (APC) on your server. This alternate caching method stores common portions of your code in memory, thereby preventing the amount of bytes that need to be transferred with each page load. Installing APC on cPanel is quick and easy for anyone who follows a few basic steps.

Instructions

    • 1

      Download the PECL extensions package. APC is one of the extensions included in the package. The latest package can be downloaded from the PECL page of php.net (see Resources). Once downloaded, open the package and locate the php_apc.dll file.

    • 2

      Log into "WHM cPanel" and navigate to the extensions directory. Note that you will need to have administrative access to add or remove extensions. Having a standard cPanel account that comes with a shared hosting package will not be suitable. You will need to have access to the WHM reseller panel, which typically comes with VPS and dedicated server packages. Adding extensions here will make the extension available to all cPanel accounts on the server.

    • 3

      Upload the php_apc.dll file to the extensions directory. Click "Add an Extension." Browse to the location of the file, then select "Upload." The APC extension will be added to the server.

    • 4

      Add the extension to the php.ini file. Open the file with a text editor such as Windows Notepad. Scroll down to the section for other extensions and add the following code to the end of the section: extension=php_apc.dll.

    • 5

      Add the extension parameters to the php.ini file. Add the following code to the end of the php.ini file:

      apc.shm_segments=1

      apc.optimization=0

      apc.shm_size=128

      apc.ttl=7200

      apc.user_ttl=7200

      apc.num_files_hint=1024

      apc.mmap_file_mask=/tmp/apc.XXXXXX

      apc.enable_cli=1

      After the code has been added, click "File" then click "Save." Use the cPanel file manager to upload the revised php.ini file to the root directory of the server.

    • 6

      Upload the apc.php file to the server. Refer back to the PECL extensions package to locate the apc.php file. Use the cPanel file manager to upload the file to the root directory of your server.

    • 7

      Open the apc.php file in your browser. Navigate to "yourname.com/apc.php" (replacing "yourname.com" with your Internet domain). This will open the Alternative PHP Cache manager for your server.

Tips & Warnings

  • APC is not compatible with Zend Optimizer. If you use Zend Optimizer to encode the source code for your website, you will need to choose between Zend and APC.

Related Searches:

References

Resources

Comments

Related Ads

Featured