The browser asks download the php file

Hello,

I know that the php page works fine.
With a computer with Windows 2000 and IE 6.0 works fine
With a computer with Windows XP and IE 6.0 or IE 7.0 the browser asks for download the php file.
What is the problem?

Best regards,

SilviaLL
silviallAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

houssam_balloutCommented:
had you tried to reset your IE Settings.
silviallAuthor Commented:
Yes I have tried it.
houssam_balloutCommented:
is that happening with every php enabled website?
Try updating your IE
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

quincydudeCommented:
where is the php file located?
Would it be just on a non php supported file storage?
silviallAuthor Commented:
The php is located in a server.
This php file works fine with some computers.
But it some computers it ask to download
houssam_balloutCommented:
I doubt that its a explorer problem
try firefox on the same computer
silviallAuthor Commented:
No, other php pages works fine.

I've IE 7.0.57
montpellierCommented:
This means that the server does not have PHP enabled.
Please see your host.
silviallAuthor Commented:
With firefox it works fine.
houssam_balloutCommented:
Then there are some problems with your explorer,
Try to install all patches (updates), remove add-ons, uninstall any tool bar if there is any.
clear cookies and all offline files, and restore to default
silviallAuthor Commented:
There are a lot of computer with this problem.
houssam_balloutCommented:
IF all computers with IE are having the same problem,
Then double check your code.
quincydudeCommented:
I would suspect it's problem from server side, please check the code or server setting.
EgonFreemanCommented:
It looks like a problem with MIME types. It also happens when PHP is not enabled on the server, or is not handling the script.

The reason why IE is trying to download the file is because the file's MIME type appears as application/x-php or something similar (IIRC), and IE doesn't know what to do with that.

To verify that PHP is indeed parsing the file, see what is saved (if it's PHP code, PHP is not enabled or is misconfigured; if it's HTML or whatever the file outputs, then that part is working).

The second part is to see if the PHP code actually outputs valid HTML? If it's certainly so, try adding

header("Content-type: text/html"); // or text/plain maybe ?

or something at the top of the file (or wherever the headers are sent), to force the MIME type output as HTML (and possibly to override whatever the server is sending). In that case IE should at least display the output as text instead of trying to download it, whatever it is.

Anyway, if PHP is parsing the file, make sure that the file returned has proper MIME type set (IE will try to guesstimate on its own, but we all know how that works). Also if the script COULD possibly return something other than HTML, make sure to build in a fall-back mechanism returning HTML.

In the end, it is most probably a MIME type misbehavior.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.