Do you want distinct PHP versions in each directory? This is possible using cPanel and the .htaccess file.

1. Log in to your cPanel account.

2. In the Software section, click on MultiPHP Manager.
MultiPHP Manager icon

3. The first thing we need to do is to get the code generated by cPanel.

4. Scroll down to the bottom of the page. Select your domain from the left side of the screen. You can view the PHP Version from the drop-down menu on the right. Please, select the appropriate PHP version from it and click on Apply.
Domain wise PHP version settings

5. First, open the /public_html/.htaccess file in the cPanel File Manager, and you will find the code generated by cPanel.
.htaccess file content

6. After you copy the code, should you wish to set the PHP to version 8 in the directory forums, create a .htaccess file in the directory /forums/ and paste the code generated in the previous step.

Congratulations, your directory forums are now running PHP 8. If you want to utilize the same version of PHP in another directory, simply copy the code from the .htaccess file and paste it into that directory.

Now, reset your PHP version from your primary domain. Should you wish to use a different PHP version on any directory, follow steps five and six, generate the code, copy that code from /public_html/.htaccess and paste it into the directory where you want to set the selected PHP version.

Was this answer helpful? 0 Users Found This Useful (0 Votes) cpanel free, cpanel hosting, cpanel tutorials, cpanel web hosting, php, multiPHP manager, free hosting with cpanel, free web hosting with cpanel