How to set a different PHP version for an Addon or Sub Domains?
To increase server stability, Ambition Host uses Cloud Linux as the operating system on our servers. The global PHP version that each cPanel account can select for their websites is a key feature of Cloud Linux.
You can easily change the PHP version on your account for an Addon or Sub Domains by using one of the following handlers, according to your desired PHP version.
Make sure to create a backup of your .htaccess file before edit it
.htaccess file in the desired directory, or add the following handler to an existing .htaccess file where you want a PHP version other than the default one.
Handler to set PHP 5.6 Version –
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php56” package as the default “PHP” programming language.
AddHandler application/x-httpd-alt-php56___lsphp .php
# php -- END cPanel-generated handler, do not edit
Handler to set PHP 7.0 Version –
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php70” package as the default “PHP” programming language.
AddHandler application/x-httpd-alt-php70___lsphp .php
# php -- END cPanel-generated handler, do not edit
Handler to set PHP 7.4 Version –
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php74” package as the default “PHP” programming language.
AddHandler application/x-httpd-alt-php74___lsphp .php
# php -- END cPanel-generated handler, do not edit
Handler to set PHP 8.0 Version –
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php80” package as the default “PHP” programming language.
AddHandler application/x-httpd-alt-php80___lsphp .php
# php -- END cPanel-generated handler, do not edit
Using one of the handlers listed above, you can now easily change the PHP version on your Addon or sub domains to the PHP version you want.