Introduction
You may need to set a specific PHP handler for a particular version of PHP or multiple versions of PHP in certain circumstances.
Procedure
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Use the
rebuild_phpconf
script with the--current
option to list the PHP version installed on the server and their current PHP handlers.[root@server ~]cPs# /usr/local/cpanel/bin/rebuild_phpconf --current
DEFAULT PHP: ea-php81
ea-php74 SAPI: suphp
ea-php80 SAPI: suphp
ea-php81 SAPI: suphp
ea-php82 SAPI: suphp
[root@server ~]cPs# - Use the
rebuild_phpconf
script with the--available
option to list the PHP handlers available for each PHP version.[root@server ~]cPs# /usr/local/cpanel/bin/rebuild_phpconf --available
ea-php74: cgi lsapi none suphp
ea-php80: cgi lsapi none suphp
ea-php81: cgi lsapi none suphp
ea-php82: cgi lsapi none suphp
[root@server ~]cPs# - Run the following command to set the PHP handler for the PHP version.
/usr/local/cpanel/bin/rebuild_phpconf --$version=$handler
Please note, "$version" must be replaced with the PHP version (i.e. ea-php74, ea-php80, etc.) and "$handler" must be replaced with an available PHP handler (i.e. lsapi, suphp, etc.)root@server ~]cPs# /usr/local/cpanel/bin/rebuild_phpconf --ea-php74=cgi
root@server ~]cPs#