On the cPanel interface you can set the default PHP version on the Select PHP version menu.
Currently the following PHP versions are available:
- PHP 4.4
- PHP 5.2
- PHP 5.3
- PHP 5.4
- PHP 5.5
- PHP 5.6
- PHP 7.0
- PHP 7.1
- PHP 7.2
If you are not using the native PHP version you can turn it on the available PHP modules, and you can modify some PHP settings directly in php.ini file with every PHP version. Note: In the PHP modules, it is important to pay attention to is not enough to checking the check boxes, you also need to save the settings on the page!
If you don't want to use the default PHP version under on your domain name, you need to create a .htaccess file in a particular domain name assigned to a folder (document_root) will be placed into one of the following lines. After setting recursively, all sub-directories will be applied to the setting.
PHP version 4.4:
AddHandler application/x-httpd-php44 .php .php5 .php4 .php3
PHP version 5.2:
AddHandler application/x-httpd-php52 .php .php5
PHP version 5.3:
AddHandler application/x-httpd-php53 .php .php5
PHP version 5.4:
AddHandler application/x-httpd-php54 .php .php5
PHP version 5.5:
AddHandler application/x-httpd-php55 .php .php5
PHP version 5.6:
AddHandler application/x-httpd-php56 .php .php5
PHP version 7.0:
AddHandler application/x-httpd-php70 .php .php5
PHP version 7.1:
AddHandler application/x-httpd-php71 .php .php5
PHP version 7.2:
AddHandler application/x-httpd-php72 .php .php5
The module enabled per PHP version is a global setting, but you can change your php.ini settings with a php.ini file placement. Starting with PHP 5.4 version, you can put a .user.ini file, each of which can override PHP settings for that folder (and its subdirectories).