List existing handlers
/usr/local/cpanel/bin/rebuild_phpconf --current
Example Output:
DEFAULT PHP: ea-php74 alt-php44 SAPI: cgi alt-php51 SAPI: cgi alt-php52 SAPI: cgi alt-php53 SAPI: cgi alt-php54 SAPI: cgi alt-php55 SAPI: cgi alt-php56 SAPI: cgi alt-php70 SAPI: cgi alt-php71 SAPI: cgi alt-php72 SAPI: cgi alt-php73 SAPI: cgi alt-php74 SAPI: cgi alt-php80 SAPI: cgi alt-php81 SAPI: cgi ea-php51 SAPI: cgi ea-php52 SAPI: cgi ea-php53 SAPI: cgi ea-php54 SAPI: cgi ea-php55 SAPI: cgi ea-php56 SAPI: cgi ea-php70 SAPI: lsapi ea-php71 SAPI: lsapi ea-php72 SAPI: lsapi ea-php73 SAPI: lsapi ea-php74 SAPI: lsapi ea-php80 SAPI: lsapi ea-php81 SAPI: lsapi
Set all handlers to lsapi
phpversions=$(/usr/local/cpanel/bin/rebuild_phpconf --current | awk '/SAPI/{print $1}'); for i in $phpversions; do /usr/local/cpanel/bin/rebuild_phpconf --"$i"=lsapi ; done
The result
/usr/local/cpanel/bin/rebuild_phpconf --current DEFAULT PHP: ea-php74 alt-php44 SAPI: lsapi alt-php51 SAPI: lsapi alt-php52 SAPI: lsapi alt-php53 SAPI: lsapi alt-php54 SAPI: lsapi alt-php55 SAPI: lsapi alt-php56 SAPI: lsapi alt-php70 SAPI: lsapi alt-php71 SAPI: lsapi alt-php72 SAPI: lsapi alt-php73 SAPI: lsapi alt-php74 SAPI: lsapi alt-php80 SAPI: lsapi alt-php81 SAPI: lsapi ea-php51 SAPI: lsapi ea-php52 SAPI: lsapi ea-php53 SAPI: lsapi ea-php54 SAPI: lsapi ea-php55 SAPI: lsapi ea-php56 SAPI: lsapi ea-php70 SAPI: lsapi ea-php71 SAPI: lsapi ea-php72 SAPI: lsapi ea-php73 SAPI: lsapi ea-php74 SAPI: lsapi ea-php80 SAPI: lsapi ea-php81 SAPI: lsapi
Set all handlers to suphp
phpversions=$(/usr/local/cpanel/bin/rebuild_phpconf --current | awk '/SAPI/{print $1}'); for i in $phpversions; do /usr/local/cpanel/bin/rebuild_phpconf --"$i"=suphp ; done