There are four PHP handlers available on cPanel servers : DSO, suPHP, FastCGI, CGI
The below command will list all the available handlers on the server :
COMMAND : /usr/local/cpanel/bin/rebuild_phpconf –available
[root@server ~]# /usr/local/cpanel/bin/rebuild_phpconf –available
ea-php54: cgi none
ea-php55: cgi none
ea-php56: cgi none
ea-php70: cgi none
Run the below command to check the current PHP handler on the server
COMMAND : /usr/local/cpanel/bin/rebuild_phpconf –current
[root@server ~]# /usr/local/cpanel/bin/rebuild_phpconf –current
DEFAULT PHP: ea-php56
ea-php54 SAPI: cgi
ea-php55 SAPI: cgi
ea-php56 SAPI: cgi
ea-php70 SAPI: cgi
On the above server you can see that CGI is the PHP handler for all PHP version and default PHP version is PHP 5.6.
suPHP handler :
Do the below steps to install suPHP handler.
1. Log into cPanel server via SSH as root
2. Run the command “yum install ea-apache24-mod_suphp” to install suPHP on easyapache 4 server
3. Login to WHM after installing “ea-apache24-mod_suphp” package and click on “MultiPHP Manager” under “Software”.
4. Click on “PHP handlers” tab
5. Click on “Edit” under “Actions”
6. Select the suPHP handler from the dropdown
7. Click on “Apply”
Use the below command to change the PHP handler from server backend
COMMAND : /usr/local/cpanel/bin/rebuild_phpconf –default=ea-phpXX –ea-phpXX=handlername
Example : I have changed the PHP handler of 5.4 version from suPHP to CGI.
[root@server ~]# /usr/local/cpanel/bin/rebuild_phpconf –current
DEFAULT PHP: ea-php56
ea-php54 SAPI: suphp
ea-php55 SAPI: suphp
ea-php56 SAPI: suphp
ea-php70 SAPI: suphp
[root@server ~]# /usr/local/cpanel/bin/rebuild_phpconf –default=ea-php56 –ea-php54=cgi
[root@server ~]# /usr/local/cpanel/bin/rebuild_phpconf –current
DEFAULT PHP: ea-php56
ea-php54 SAPI: cgi
ea-php55 SAPI: suphp
ea-php56 SAPI: suphp
ea-php70 SAPI: suphp