To change your PHP version first you need to:

1. Access your file manager or your FTP account.

2. Navigate to the folder where you want to change the PHP version and create or modify the .htaccess file.

3. Edit your .htaccess file and add this code:

<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-lsphp71
</FilesMatch>

The second line is what defines which PHP version your folder will be using, here is a table for reference (lsphp56 means PHP 5.6):

application/x-lsphp52
application/x-lsphp53
application/x-lsphp54
application/x-lsphp55
application/x-lsphp56
application/x-lsphp70
application/x-lsphp71
application/x-lsphp72

Save your file and just run your website using subfolder address or subdomain. Ex:

mywebsite.tld/testphp

If you want to test if the code was applied, create a new file named phpinfo.php, add this code and save:

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

Did this answer your question?