Your web hosting partners since 2004.
Buy now »

How to change default PHP version on cPanel server through command line

To get the currently installed PHP versions:

# /usr/local/cpanel/bin/rebuild_phpconf --current
DEFAULT PHP: ea-php74
ea-php74 SAPI: cgi
ea-php80 SAPI: cgi

To change the default version:

# /usr/local/cpanel/bin/rebuild_phpconf --default=ea-php80

Check it's worked:

# rebuild_phpconf --current 
DEFAULT PHP: ea-php80
ea-php74 SAPI: cgi
ea-php80 SAPI: cgi
# php -v
PHP 8.0.16 (cli) (built: Mar  2 2022 02:13:51) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.16, Copyright (c) Zend Technologies

Yup, we're on PHP8.

Last updated: 2022-03-07

« Go Back

Order now »

Amazing as usual no problems, just what you'd expect from a top class provider.