• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

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
0
silviall
Asked:
silviall
  • 5
  • 5
  • 2
  • +2
1 Solution
 
houssam_balloutCommented:
had you tried to reset your IE Settings.
0
 
silviallAuthor Commented:
Yes I have tried it.
0
 
houssam_balloutCommented:
is that happening with every php enabled website?
Try updating your IE
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
quincydudeCommented:
where is the php file located?
Would it be just on a non php supported file storage?
0
 
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
0
 
houssam_balloutCommented:
I doubt that its a explorer problem
try firefox on the same computer
0
 
silviallAuthor Commented:
No, other php pages works fine.

I've IE 7.0.57
0
 
montpellierCommented:
This means that the server does not have PHP enabled.
Please see your host.
0
 
silviallAuthor Commented:
With firefox it works fine.
0
 
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
0
 
silviallAuthor Commented:
There are a lot of computer with this problem.
0
 
houssam_balloutCommented:
IF all computers with IE are having the same problem,
Then double check your code.
0
 
quincydudeCommented:
I would suspect it's problem from server side, please check the code or server setting.
0
 
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 5
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now