Knowledge Base

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, on 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. In the SOFTWARE section of the cPanel home screen, click Select PHP Version.
  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