What are the best PHP Accelerators to speed up WordPress or other PHP-based software?

w3speedup
W3 SpeedUp
Published in
5 min readSep 14, 2020

--

PHP accelerators assist in improving the speed and performance of PHP-based software such as WordPress. They make it possible to run high traffic sites powered by PHP applications. The performance benefits of PHP accelerators vary a lot since it depends on multiple factors, including other optimizations that your site might need.

Here, you’ll learn about PHP accelerators, the working of PHP accelerators, why you need them, and which PHP accelerators are the best for your WordPress site.

What are PHP Accelerators?

A PHP accelerator is a PHP extension designed to boost the performance of applications written in PHP. Such an extension works by caching opcode, or operation code, generated by PHP files. This is why PHP accelerators are sometimes also referred to as Opcode Caching.

Photo by Ben on Unsplash

PHP scripts are written in human-readable syntax, but a server or a CPU cannot understand this code directly. It needs to be converted into a format that the server can read. This is where Opcode comes in. The Opcode is a part of the machine language instruction that directs the server on what operations to perform. Other parts of machine language instructions include operands. These are the items that the Opcode manipulates.

Whenever a user requests something on your site, generating the opcode from PHP scripts can be highly taxing on your webserver. You can solve this problem by storing the opcode as a cache (OpCache) after it’s generated. Then, you can serve it directly to all the subsequent users without the server’s involvement. This is what a PHP accelerator does.

Best PHP Accelerators

1. Zend OpCache

A component of Zend Server, the open-source Zend Opcache speeds up PHP execution by optimization and caching of Opcode. Zend Opcache has been integrated into PHP from the PHP version 5.5.

Zend Opcache relies on shared memory to store precompiled script bytecode. This eliminates two m ajor stages: reading code from the disk and compiling code on future access. Take note that Zend Opcache doesn’t load Zend Guard encoded files. You need Zend Guard Loader to get this feature. The accelerator is actively maintained. You can find more information on its GitHub page.

2. Alternative PHP Cache (APC)

Alternative PHP Cache is a free, open-source framework. It is designed to cache the PHP bytecode compiler output in shared memory. APC reduces parsing and disk I/O overhead, as well as a user data shared memory cache.

You can get a maximum possible result of a 3x increase in a page generation speed. The framework has a mature codebase, thanks to numerous dedicated contributors. It works with all PHP versions. You can find the official installation help here.

3. Windows Cache Extension for PHP

This free and open-source PHP accelerator was developed for PHP by Windows. Apart from PHP opcode cache, it also includes file cache, object/session cache, resolve file path cache, lock/unlock APIs, file change notifications, and more. Such a group of caches significantly improve the performance of PHP applications on Windows. Windows Cache Extension for PHP works with x86 versions of PHP 5.2–5.5. You can check out help and API documentation here.

4. ionCube PHP encoder

The availability of ionCube PHP Accelerator on a wide variety of platforms led to its adoption from small sites to giants like Yahoo!. There are 3 editions of the ionCube PHP Encoder — Basic, Pro, and Cerberus. All of them offer compiled PHP encoding and optional encryption for non-PHP files. Pro and Cerberus editions provide some additional features.

The ionCube PHP Encoder is available for Linux, Windows, OS X, and FreeBSD. All editions provide easy automation with the help of command-line Encoders. The Pro and Cerberus editions also include different tools for the creation of the license file.

5. eAccelerator

eAccelerator is a free open-source PHP optimizer and accelerator. It boosts the performance of PHP scripts by caching them in their compiled state. In this way, the overhead of compiling is almost completely eliminated. eAccelerator also optimizes scripts to improve their execution time.

eAccelerator reduces the server load and increases the speed of your PHP code by one to ten times. It stores compiled PHP scripts in shared memory and then executes the code from it, directly. It creates locks only for a short time while searching for a compiled PHP script in the cache. So, one script can be executed at the same time by several engines. Files that cannot fit in the shared memory are cached on disk only.

You can check out eAccelerator’s Github repository here.

6. NuSphere PhpExpress

NuSphere PhpExpress is another free accelerator that works with PHP opcode cache. It loads both plain PHP and files encoded with Nu-Coder into the PHP engine to improve loading time and performance.

NuSphere PhpExpress is available on Windows, Linux, Mac OS X, NetBSD, FreeBSD, and Solaris. It is very easy to install and use. At the same time, it provides a significant increase in the execution speed of PHP scripts. It can be downloaded and distributed for free without any limitations.

Final Words

PHP’s default OPcache functionality provides a significant performance improvement for WordPress sites. Usually, the speed improvements are as much as three times. If you have a medium to high traffic site, then we highly recommend enabling opcode caching on your server.

As for the best PHP accelerator, you’ll most likely have to test a couple and see what works best for your site. You can also install the APC PHP extension to take advantage of its userland shared memory caching functionality.

Got questions about installing PHP accelerators on your server? Let us know in the comments below or you can write to us here.

--

--

w3speedup
W3 SpeedUp

Specializes in website performance optimization and web acceleration. I regularly writes on all subjects and platform related to Speed Optimization