php page not displayed

Asked by Christian Lehmann on 2010-01-05

I have Firefox 3.5.6 installed both under Windows 2000 and under Ubuntu 9.10. The problem occurs only under Ubuntu.

I have no local web server installed. [I know I could do this.] If Firefox receives a php-file from an external web server, it displays it okay. [Likewise, so does Firefox under Windows, except that it does not, of course, execute php commands.] If, instead, I load a php-file from my local disk, it displays the message (translated from the German):

Opening filename.php

You want to download the following file:
- filename.php

Question information

English Edit question
Ubuntu firefox-3.5 Edit question
No assignee Edit question
Solved by:
Christian Lehmann
Last query:
Last reply:
Revision history for this message
Appiah (appiah) said :
Revision history for this message
Christian Lehmann (christian-lehmann) said :

In that thread, Micah Gersten says
"This is standard behavior."
thereby dismissing the issue.

However, this is just not so. The standard behavior is the behavior shown by Firefox under Windows as described above.

Revision history for this message
Christian Lehmann (christian-lehmann) said :

Micah Gersten schrieb:
> Bug #503259 status changed in firefox-3.5 in ubuntu:
> New => Incomplete
> Status change explanation given by Micah Gersten:
> Thank you for reporting this to Ubuntu. Is the bug that Firefox won't
> display the source code or that you are not given a list of Editors to
> choose from?
> "php page not displayed"
> This bug is linked to #96275.
> php page not displayed
Let me explain again: If the user is getting the browser to display a
PHP file which the browser is not receiving from a server (which could
execute the PHP commands) - thus, typically a local file -, then the
browser should display the file as if it were a HTML file (ignoring, of
course, the PHP commands). This is standard behavior for Mozilla
browsers (Firefox 3.5.3, SeaMonkey 2.0.1) under Windows. It is only
under Ubuntu that Firefox behaves as if it did not know what a PHP file
is. And, true, the Internet Explorer 7 doesn't know it, either; but that
is generally not regarded as an imitable model of a browser.)

Christian Lehmann

Prof. Dr. Christian Lehmann
Philosophische Fakultät
Postf. 900221
D-99105 Erfurt

Tel.: +49/361/737 -4200 (Sekr.)
   -4201 (selbst)
Fax: -4209
E-Post: <email address hidden>

Revision history for this message
Curtis Lee Bolin (curtisleebolin) said :

Have you tried to just rename them ".html". After reading you question I used this as my test file "". I just renamed "docs.php" to "docs.html". It then opened in firefox and chrome with no problem.

If it doesn't work, could you post a link to the php file you are trying to view?

Revision history for this message
andrew prudente (aprudente-99) said :

You must install apache2 in order for the local loopback to work. Then you must place your web files in /usr/www which is where apache will load them from.

Revision history for this message
Christian Lehmann (christian-lehmann) said :

Dear discussants,

many thanks for your advice. Of course, the method suggested by Curtis works, but it is not feasible for the entire set of the php files of my wbsite. And what Andrew says is true, too; but that was already presupposed in my initial question.

The net result of it all remains, to my mind, a bug: If Firefox 3.5.6 under Ubuntu 9.10 [sorry, at present I have no access to more up-to-date installations] is asked to display a local php file directly, i.e. as file://filename.php, and not as http://localhost/filename.php, then it acts as if it does not know what a php file is. What it should do is behave as the Windows Firefox does, viz. display the file ignoring the php commands.

Thanks again. I think we can close the thread and hope that Firefox developers fix this bug.