How to enable PHP opcode caching

This article describes how to enable PHP opcode caching.

Although many server accounts already have opcode caching enabled by default, some accounts (for example, Turbo Reseller servers) do not.

About APC and OPcache

The Alternative PHP Cache (APC) and OPcache provide opcode caching. By caching the compiled operation codes (opcodes) of PHP scripts, APC and OPcache enable sites to serve page content significantly faster.

APC is a PHP extension that runs on PHP 5.4 and earlier versions. Because it is a separate extension, it may or may not already be installed on your server. For information about how to determine if APC is installed on your server, please see this article.

OPcache is a drop-in replacement for APC that runs on PHP 5.5 and later versions. OPcache is a core component built into PHP, so it does not require separate installation like APC does.

Enabling opcode caching

To enable opcode caching for your account, follow these steps:

  1. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  2. Open the PHP Selector:
    • If you are using the Jupiter theme, on the Tools page, in the Software section, click Select PHP Version:

      cPanel - Select PHP Version icon

    • If you are using the Paper Lantern theme, in the SOFTWARE section of the cPanel home page, click Select PHP Version:

      cPanel - Select PHP Version icon

    If you do not see the Select PHP Version icon, your server does not support this feature. 
  3. Select the check box next to the opcode caching extension you want to enable:

    • If you are using PHP version 5.4 or older, select apc.
    • If you are using PHP version 5.5 or newer, select opcache.
  4. Click Save. Opcode caching is now enabled.

More Information

Article Details

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.