1

I am trying to change the php version in my server using htaccess. I am following this question's answer how to change php version in htaccess in server But did not work for me. When I entering my project, it's downloading a file. Would someone help me to solve this issue, please? Here is by .htaccess bellow-

<IfModule mod_rewrite.c>

   AddHandler application/x-httpd-php71 .php
   RewriteEngine On

   RewriteBase /
   RewriteRule ^index\.php$ - [L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule . /index.php [L]

</IfModule>
3
  • This has nothing to do with cPanel. That depends entirely on how your hoster has setup PHP. Chances are they're using FCGIProxyPassMatch, not MIME handlers. (Also: <IfModule> begone!) Commented Feb 4, 2018 at 12:42
  • 1
    php71 ? I think it should be php7 if your host has php7 installed. Commented Feb 4, 2018 at 13:24
  • I have no 'Select PHP Version' option. Commented Feb 4, 2018 at 13:35

1 Answer 1

1

Finally, AddHandler application/x-httpd-php70 .php worked for me. Thank you!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.