Manage PHP Handlers in Easyapache 4
Last modified: September 28, 2020
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
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](/whm/scripts/the-rebuild_phpconf-script/) 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 example:
Change the system default version of PHP
To change the system default version of PHP, run the following script, where
package represents that name of the PHP package that you wish to use:
You can also change your system's default version of PHP in WHM's [MultiPHP Manager](/whm/software/multiphp-manager-for-whm/) interface (WHM >> Home >> Software >> MultiPHP Manager).
Change the version of a PHP handler
To change the PHP handler that a specific version of PHP uses, run the following script, where
default represents your default PHP version, package represents the PHP package that you want to change, and
handler represents the PHP handler that you wish to use:
/usr/local/cpanel/bin/rebuild_phpconf --default=default --package=handler
If you wish to change the handler of more than one version of PHP, you can pass the
--package=handler option multiple times.
You must include