To run a PHP version on the server under a folder/directory that is different from the one under your cPanel Control Panel -> "Select PHP Version", please add this line to your .htaccess file inside the folder you wish to change:
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php56___lsphp
</FilesMatch>
Where x-httpd-alt-php56___lsphp is the PHP version you are seeking. Our servers support PHP 5.6 - 8.x+
The part php56 is interchangeable to php73 for PHP 7.3 , php80 for PHP 8.0
Here are some examples:
PHP 7.4:
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php74___lsphp
</FilesMatch>
PHP 8.1:
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php81___lsphp
</FilesMatch>
PHP 8.3:
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php83___lsphp
</FilesMatch>
For more information on how alternative PHP version works for subdomains and sub folders, please see: