PHP Files won't open in firefox

User Help for Mozilla Firefox
Azurite
Posts: 4
Joined: March 6th, 2005, 12:26 pm
Location: Northridge, CA
Contact:

PHP Files won't open in firefox

Post by Azurite »

It's very odd, but lately, a few (unrelated) webpages keep prompting me to open PHP files with some program other than the browser. For example, I'll click on a link in a webpage that goes to a PHP file, and instead of opening in that tab or that window, it prompts me to download the file and open it with some program. I tried setting it to open in firefox.exe, but all that does is open a new tab and pop up the download box again.

This happens when I try to Open File for any PHP files on my computer, too (to preview how they look). This doesn't happen with all webpages, so I'm pretty confused here.

I tried opening the pages in IE Tab, but all that does is bring me to an Action Canceled page.

I have FF 1.5.0.1, with all my extensions as up-to-date as can be.
old FatJohn
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old FatJohn »

Sounds like a MIME type issue to me. Got example URLs that would do that now? I'm not sure how one would deal with local php pages.
Azurite
Posts: 4
Joined: March 6th, 2005, 12:26 pm
Location: Northridge, CA
Contact:

Post by Azurite »

One in particular was http://www.shonenjump.com/bottomlinks/contact.php. I can't remember any others off the top of my head, but I do remember this happening more than once at various pages.
juro
Posts: 3
Joined: March 22nd, 2006, 2:21 am
Contact:

Post by juro »

Jup, I get the exact same issue.
Some php-sites do not open (dokument is empty), although I can access them using Internet Explorer and the same build Firefox (1.5.0.1) using the exact same profile on a different PC.
Guest
Guest

Post by Guest »

Browsers don't understand PHP, only (x)html, css, JavaScript, and some xml standards. PHP pages on the web are preprocessed by the server to turn the PHP code into the corresponding html, and that's why (usually) you can see the php pages without a problem. As it's been said, the server must be configured to serve PHP files as text/html instead of text/plain, wich happens sometines on some servers. This is a common error because IE doesn't care about the served mime type, and if it thinks the file looks like html, renders it like so; Fx, on the other hand, renders the file as it's been said to. You can check the served mime type opening it and then going to Tools -> View page information.

About local files, again, you need a server to preprocess the PHP files. A nice option is an Apache server with PHP, wich happens to be a free and powerful combination, though can be a bit confusing to configure. You can get a prebuilt package like XAMPP, wich you'd only need to install through the wizard.
juro
Posts: 3
Joined: March 22nd, 2006, 2:21 am
Contact:

Post by juro »

Guest, thank you for time invested in explaining what php is and how it is handled.

Now let us get back to the problem at hand. If it were a problem concerning Firefox not being able to handle some Mime type or a faulty server configuration I would not be able to access the site at all using Firefox (same build) which I can (see my first post). So this is not a problem concerning a server configuration, but a problem with my Firefox configuration.
Guest
Guest

Post by Guest »

Maybe that link you're clicking on is .html, thus the correct mime-type is delivered. So only .php files are badly configured on that server.

Or maybe the "good" page contains a
header("CONTENT-TYPE: text/html");
statement.
jeronimo
Posts: 269
Joined: August 5th, 2004, 6:17 am
Location: Cusco, Peru

Post by jeronimo »

I've noticed the same problem on a forum:

http://www.joexx.de/forum/viewforum.php?f=4
(bummer, offline at the moment...)

Fx 1.5.0.1 sometimes asks me to download the file, and sometimes it just enters the forum. Very strange.

As the site is offline now, I haven't been able to take a look at the mime-type, but I will as soon as it's back.
old FatJohn
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old FatJohn »

Azurite wrote:One in particular was http://www.shonenjump.com/bottomlinks/contact.php. I can't remember any others off the top of my head, but I do remember this happening more than once at various pages.


That page is sending back no headers, thus Firefox has no idea what to do with the file the link points to. This is correct behaviour according to standard (W3C) spesification. Contact webmaster. Include Web Sniffer results.

EDIT: added the W3C link
Last edited by old FatJohn on March 23rd, 2006, 8:48 am, edited 1 time in total.
old FatJohn
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old FatJohn »

This page http://www.joexx.de/forum/viewforum.php?f=4 works for me as it sends back correct type: text/html headers.
jeronimo
Posts: 269
Joined: August 5th, 2004, 6:17 am
Location: Cusco, Peru

Post by jeronimo »

Yes, it does now, must have been a problem with the site itself, everything seems to be working fine now.

Thanks.
Azurite
Posts: 4
Joined: March 6th, 2005, 12:26 pm
Location: Northridge, CA
Contact:

Post by Azurite »

On the other hand, I still can't access the page. Obviously, I can't contact the webmaster, since the contact page is the one that's not loading! I tried it on a different computer running Firefox 1.5.0.1; different profile and a few of the same extensions. I don't get the pop-up to open up PHP files in another program, but another tab tries to open up, but ends up blank.
old FatJohn
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old FatJohn »

Open it with IE if you want to mail the webmaster about it.
Guest
Guest

Post by Guest »

http://www.shonenjump.com/bottomlinks/contact.php

Blank in Firefox, IE says "page can't be found".

Site/server issue.
evolutionwebinc
Posts: 2
Joined: April 5th, 2006, 4:28 pm
Location: Miami FL
Contact:

Post by evolutionwebinc »

I just posted recent topic similar. I develope offline and have always used Firefox to view PHP files which it has done quite well. Of course it does not process any PHP code but does display the html code just fine...or it did until yesterday !! Now if I click on a local PHP file Firefox just downloads it but will not open it. My settings are for Firefox to be the default application to open a PHP file and in the past that's what happened. I click a local php file and it opened in Firefox. Suddenly it just downloads only and I cannot view anything locally.

I can view them online only.

What broke and how do I fix it?

Thanks.
Locked