How to set the PHP version for any folder via htaccess in cPanel?

How to set the PHP version for any folder via htaccess in cPanel? [STEP BY STEP]☑️

Today in this tutorial we will describe you how to select a different PHP version on each folder via cPanel.You can also watch this short video on how to set a PHP version for any folder via htaccess file in cPanel.

Follow the steps given below to select a different PHP version on each folder in cPanel:

Step::1 Log into cPanel

Step::2 Open File Manager

Step::3 Open any folder and create an .htaccess file inside it

How to set the PHP version for any folder via htaccess in cPanel
Creating .htaccess file in cPanel

 

Step::4 After creating .htaccess file you will need to edit and paste a code from the link given below:

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

[Make sure you replace the php version in the code with the actual PHP version. For ex: if you want to change the version to 7.0 then just remove  “php56” and write there “php7.0”]

How to set the PHP version for any folder via htaccess in cPanel
Edit .htaccess file

Step::5 Click Save and close the Editor.

How to set the PHP version for any folder via htaccess in cPanel
How to set the PHP version for any folder via htaccess in cPanel

Hope this helps!!

For more information, kindly follow us on social media like Twitter and Facebook and for video tutorials, subscribe to our YouTube channelhttps://youtube.com/redserverhost.com

Facebook Page- https://facebook.com/redserverhost

Twitter Page- https://twitter.com/redserverhost.com

If you have any query, feel free to let us know via the comments section below.

Thanks for Reading!!!

Tags: cheap linux hostingbuy linux hostingcheap reseller hostingbuy reseller hostingbest reseller hostingcheap web hostingcheapest web hostingcheapest reseller hosting,  cheap reseller hostcheap linux hostcheapest linux hostingbest linux hostingbest web hosting

Scroll to Top