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

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

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 :
#3

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?
>
> https://bugs.edge.launchpad.net/ubuntu/+source/firefox-3.5/+bug/503259
> "php page not displayed"
>
> This bug is linked to #96275.
> php page not displayed
> https://answers.edge.launchpad.net/ubuntu/+source/firefox-3.5/+question/96275
>
>
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
Universität
Postf. 900221
D-99105 Erfurt

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

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

Have you tried to just rename them ".html". After reading you question I used this as my test file "http://www.php.net/docs.php". 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 :
#5

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 :
#6

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.