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 (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 (Home >> Service Configuration >> Configure PHP and suEXEC).  

Configure PHP handlers

Important:

In EasyApache 4, you activate and deactivate suEXEC by installing or uninstalling 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:

# /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:

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

In the above example, $package represents the name of the PHP package that you wish to use. Your script might resemble the following: 

/usr/local/cpanel/bin/rebuild_phpconf --default=ea-php55

Note:

You can also change your system default version of PHP in WHM's MultiPHP Manager interface (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:

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

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: 

/usr/local/cpanel/bin/rebuild_phpconf --default=ea-php55 --ea-php54=suphp

To change the PHP handler for each version to use CGI, run the following script:

/usr/local/cpanel/bin/rebuild_phpconf --default=ea-php56 --ea-php54=cgi --ea-php55=cgi --ea-php56=cgi

To change the handler of more than one version of PHP, add each version and handler to the end of the script in the --$package=$handler format.  

Important:

You must include --default.

Additional documentation