Change PHP Version with .htaccess File
You can change the PHP version through cPanel easily. However, sometimes it is required to change through .htaccess file. For example, if you have multiple websites in one cPanel account and you need different versions of PHP.
If the doesn't exist, create a new .htaccess file. This file contains instructions for Apache server to perform the tasks.
Place the following code at end of the .htaccess file to avoid any problem.
# Use PHP74 as default
AddHandler application/x-httpd-php74 .php
<IfModule mod_suphp.c>
suPHP_ConfigPath /opt/php74/lib
</IfModule>
The PHP74 defines the PHP version 7.4. You can change the 74 to your desired PHP version. Also, your server or host should support that PHP version.