PHP Accelerators
A PHP accelerator is an extension designed to increase the performance of applications written in the PHP programming language.
These accelerators function by caching the compiled bytecode of your human-readable PHP scripts. Typically, PHP code is compiled and executed at runtime.
However, PHP accelerators cache the compiled code, thus eliminating the need for recompilation and reducing CPU usage at the expense of increased memory consumption.
By implementing PHP acceleration, your PHP code can execute more rapidly, often cutting execution time in half. To the user, this results in a combination of reduced page generation time, network latency, and page rendering time.
Within the AccuWeb.Cloud PaaS environment, the most commonly used PHP accelerators include:
- APC (Alternative PHP Cache)
- Xcache
- eAccelerator (compatible with PHP 5.3 and 5.4 only)
- ZendGuardLoader (compatible with PHP 5.3 only)
Activating a PHP Accelerator
To activate a PHP accelerator, follow these instructions:
Step 1. Access Server Configuration:
- Click the “Config” button for the server in your environment.
Step 2. Edit the php.ini File:
- Navigate to the etc directory and open the php.ini file.
Step 3. Uncomment the Accelerator:
- Find the section for the desired accelerator and uncomment the corresponding line.
- extension=apc.so
- extension=eaccelerator.so
- extension=xcache.so
- extension=ZendGuardLoader.so
Step 4. Configure Accelerator Settings:
- Adjust any necessary settings for the chosen module within the php.ini file.
Step 5. Save Changes and Restart:
- Save the changes to the php.ini file and Restart the node.
That’s all. The chosen PHP accelerator is now activated.