November 29th in Linux/Unix, PHP Scripts by .

Fix -> PHP files are downloading when viewed in Browser

i had a sudden wierd problem with my site running cpanel. when ever i click on the link in my website, the browser shows a download box for the php file instead of showing a webpage. I did use mod rewrite to make url friendly

How to Fix

I figured out later the problem is apache doesnt know to parse those files with php. You you have to create a file .htaccess in your site public_html folder and place the following line to fix the problem

AddHandler application/x-httpd-php .php .phtml

Then try to browse your site and soon the apache wont show the dialog box.

Similar Posts:

One Comment

Leave A Comment.