Do you have a single domain, or do you want to use a different PHP version for each folder? Do you have software installed in a folder (e.g., /blog) that requires PHP 5.x, but you want to use PHP 7.x instead? If so, you can achieve this using cPanel and the .htaccess file.
- Log into your cPanel account.
- In the "Software" section, click on the "MultiPHP Manager" icon.

- If you are new to this, the first step is to get the code generated by cPanel.
- Scroll down to the end of the page, select your domain from the left side, and you will see the "PHP Version" option with a drop-down list on the right. Select the appropriate PHP version from the drop-down menu and click the "Apply" button.

- Open the
/public_html/.htaccessfile in the cPanel File Manager or your FTP client. You will find the code generated by cPanel there.
- To set PHP 7 for a specific folder (e.g., /forum), create a
.htaccessfile in that folder and paste the code generated in the previous step. - Congratulations! Your
/forumfolder now uses PHP 7. If you want to set any other folder to use the same PHP version, simply copy the code from the.htaccessfile and paste it into the desired folder's.htaccessfile.
Note: To reset your PHP version for your main domain, repeat steps 5 and 6. Generate the code, copy it from /public_html/.htaccess, and paste it into any folder where you want to set your selected PHP version.