Updated: 22 October 2026 · Applies to: PHP 5.5 and later

This article used to cover installing eAccelerator, a third-party PHP opcode cache. eAccelerator's own download source no longer resolves, and it was never updated for PHP 7 or later, so it cannot run on any currently supported PHP version. The real current answer is OPcache, which ships as part of PHP itself from PHP 5.5 onward and does the same job (caching compiled PHP bytecode in memory so scripts do not need to be parsed and compiled on every request).

This project's own WHMCS performance guidance (see this knowledgebase's WHMCS-specific articles) is separate: never enable OPcache for WHMCS specifically, since WHMCS itself advises against it. The guidance below is for PHP applications in general, outside WHMCS.

Check whether OPcache is already enabled

php -v

If OPcache is active, the output includes a line mentioning "Zend OPcache". You can also check directly:

php -m | grep -i opcache

Many current PHP packages (including cPanel's EA-PHP builds) ship with OPcache already enabled by default; check before assuming you need to turn it on.

Enable it, if it is not already on

Find your PHP configuration (on a cPanel server, usually an INI editor in WHM, or a file under /opt/cpanel/ea-phpXX/root/etc/php.d/; elsewhere, your main php.ini), and set:

opcache.enable=1
opcache.memory_consumption=128
opcache.max_accelerated_files=10000

memory_consumption is the shared memory OPcache uses, in MB; max_accelerated_files is how many distinct PHP scripts it can cache at once. Both are reasonable starting points for a typical site, not hard requirements; a large codebase may need a higher max_accelerated_files.

Choose how it checks for changed files

opcache.validate_timestamps=1
opcache.revalidate_freq=2

With validate_timestamps=1, OPcache checks whether a file changed on disk (at most every revalidate_freq seconds) and recompiles it if so; this is the safer default while developing. In production, many sites instead set opcache.validate_timestamps=0 for maximum speed, since OPcache then never checks file timestamps at all. With that setting, you must manually clear the cache after every deploy, either by calling opcache_reset() from a script or by restarting PHP-FPM (or Apache, on a mod_php setup), or visitors can keep being served old code after you have already updated it.

Restart PHP to apply the change

systemctl restart php-fpm

Or, on a mod_php setup:

systemctl restart httpd

Confirm it is working

php -r 'var_dump(opcache_get_status(false)["opcache_enabled"] ?? false);'

This should print bool(true). Note that PHP's command-line SAPI usually has OPcache disabled by default even when the web server's PHP has it enabled; set opcache.enable_cli=1 separately if you specifically need to test OPcache from the CLI.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket