?
Solved

The browser asks download the php file

Posted on 2008-11-11
14
Medium Priority
?
276 Views
Last Modified: 2013-12-13
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
Comment
Question by:silviall
  • 5
  • 5
  • 2
  • +2
14 Comments
 
LVL 17

Expert Comment

by:houssam_ballout
ID: 22929417
had you tried to reset your IE Settings.
0
 

Author Comment

by:silviall
ID: 22929434
Yes I have tried it.
0
 
LVL 17

Expert Comment

by:houssam_ballout
ID: 22929445
is that happening with every php enabled website?
Try updating your IE
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:quincydude
ID: 22929467
where is the php file located?
Would it be just on a non php supported file storage?
0
 

Author Comment

by:silviall
ID: 22929506
The php is located in a server.
This php file works fine with some computers.
But it some computers it ask to download
0
 
LVL 17

Expert Comment

by:houssam_ballout
ID: 22929519
I doubt that its a explorer problem
try firefox on the same computer
0
 

Author Comment

by:silviall
ID: 22929532
No, other php pages works fine.

I've IE 7.0.57
0
 

Expert Comment

by:montpellier
ID: 22929533
This means that the server does not have PHP enabled.
Please see your host.
0
 

Author Comment

by:silviall
ID: 22929553
With firefox it works fine.
0
 
LVL 17

Expert Comment

by:houssam_ballout
ID: 22929578
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
 

Author Comment

by:silviall
ID: 22929653
There are a lot of computer with this problem.
0
 
LVL 17

Expert Comment

by:houssam_ballout
ID: 22929684
IF all computers with IE are having the same problem,
Then double check your code.
0
 
LVL 15

Expert Comment

by:quincydude
ID: 22929772
I would suspect it's problem from server side, please check the code or server setting.
0
 

Accepted Solution

by:
EgonFreeman earned 750 total points
ID: 23015885
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question