This document only applies to systems that run cPanel & WHM version 11.52. If your system runs cPanel & WHM version 54 or higher, use WHM's MultiPHP Manager interface (WHM >> Home >> Software >> MultiPHP Manager) to manage your PHP handlers. To manage your PHP handlers manually in cPanel & WHM version 54 or higher, read our The rebuild_phpconf Script documentation.
In cPanel & WHM version 11.52, EasyApache 4 uses the
rebuild_phpconf script to manage your PHP default version and PHP handlers. This differs from EasyApache 3, which uses the Configure PHP and suEXEC interface (WHM >> Home >> Service Configuration >> Configure PHP and suEXEC).
Configure PHP handlers
In EasyApache 4, the system activates or deactivates suEXEC when you install or uninstall the suEXEC module. In EasyApache 3, the
rebuild_phpconf script turns it on and off.
To change your PHP handlers or change your system default PHP version in EasyApache 4, perform the following steps on the command line:
Current PHP configuration
Retrieve your current configuration with the following script:
You will receive output that resembles the following:
Change the system default version of PHP
To change the system default version of PHP, run the following script:
In the above example,
$package represents the name of the PHP package that you wish to use. Your script might resemble the following:
You can also change your system default version of PHP in WHM's MultiPHP Manager interface (WHM >> Home >> Software >> MultiPHP Manager).
Change a PHP version's handler
To change the PHP handler that a specific version of PHP uses, run the following script:
In the above example,
$default represents your default PHP version,
$package represents the name of the PHP package that you want to change, and
$handler represents the PHP handler that you wish to use. Your script might resemble the following:
To change the PHP handler for each version to use CGI, run the following script:
To change the handler of more than one version of PHP, add each version and handler to the end of the script in the
You must include
PHP Security Concepts — Learn how to increase the security of your PHP implementation.
How to Edit Your php.ini File — Learn how to make changes to your