views:

261

answers:

2

Hi friends,

when I run the url at localhost for a php file like:

http://localhost/project/admin/

it doesnt open the index.php, but gives panel for downloading the file with the message below :/

You have chosen to open

which is a: application/x-httpd-php

from: http://localhost

What should Firefox do with this file?

Openwith - Save... etc...

any idea what is going on? :(

appreciate helps!! thanks a lot

A: 

PHP is not correctly installed on the server or Apache is not using mod_php

In the case of this happening in IIS. I would say that the mimetype is not setup correctly and that the server doesn't know how to handle the extension ".php"

PieterG
i can run all my other php works well :/
artmania
+1  A: 

It sounds like an incorrect Content-type header is being sent. This header sets the mime-type for the data the browser receives and, if the browser doesn't have a handler to render that specific mime-type, it will ask to open/save the file instead.

I would start by checking your PHP file for a header() statement and a mis-typed content-type.

Andy E
Looks like apache is tresting this PHP file as application/x-httpd-php and not text/html (/xhtml, html+xml etc.).
Migol