Page tree
Skip to end of metadata
Go to start of metadata

Warning:

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.

Overview

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

Important:

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:

/usr/local/cpanel/bin/rebuild_phpconf --current

You will receive output that resembles the following example:

# /usr/local/cpanel/bin/rebuild_phpconf --current
Available handlers:
 ea-php54: cgi suphp
 ea-php55: cgi suphp
 ea-php56: cgi suphp
Configured handlers:
 ea-php54: suphp
 ea-php55: suphp (system default)
 ea-php56: suphp

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:

/usr/local/cpanel/bin/rebuild_phpconf --default=$package


Note:

You can also change your system's 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, 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.   

Important:

You must include --default.

Additional documentation