php files not recognized in browser

Christopher Browne cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Fri May 13 04:00:21 UTC 2005


On 5/13/05, Alex Maynard <amaynard-vQ8rsROW2HJSpjfjxSPG1fd9D2ou9A/h at public.gmane.org> wrote:
> 
> Hi, I've got a newby question on a php set up problem.  This is probably a
> trivial question, but I'm stuck on it and would be grateful for any help I
> can find.
> 
> I set up apache/php/other application on linux using
> http://www.apachefriends.org/en/.
> 
> Everything including their test step worked fine.
> 
> But, when I tried to open a php file on my computer using mozilla I got
> the following error message:
> 
> The file "hello.php" is of type application/x-httpd-php, and Mozilla does
> not know how to handle this file type. The file is located at:
> /home/amaynard/share/private_html/php  What should Mozilla do with this
> file?

That evidently means that instead of Apache invoking the PHP
interpreter on the file, it is, instead, sending the PHP file as a
document.

You presumably need some change of configuration to Apache to make it
run the PHP file.  I think I once accomplished this by changing
execute permissions on the file; something like "chmod a+x hello.php"

There's probably something you can do to Apache instead.
 
> The strange thing is that Mozilla does recognize/open .php files on the internet 
> (just not on
> my computer). And opera seemed to be able to open the .php file
> on my computer but I'm not sure it displayed correctly.

The Dumb Thing is for applications to export that sort of information.

http://www.w3.org/Provider/Style/URI.html
"Cool URIs don't change."

It's arguable that having suffixes on documents on the web is downright WRONG.

In the above sorts of cases, it's certainly causing you confusion; you
are thinking that a ".php file" is something that your web browser
should be processing, which is Absolutely Wrong.

-> When a URI ends in .asp, that DOESN'T mean your browser has to have
a VB interpreter in it
-> When a URI ends in .cgi, that doesn't imply ANYTHING about what
your web browser does.
Likewise...
(loop
  for suffix in '("pl" "pl" "py" "jsp" "class" "o" "asp" "php")
  for language in '(prolog perl python JavaServerPages Java C VB PHP4)
  do (format t "A URI ending in ~A doesn't imply your web browser does
~A work~%"))

The suffix of the URL doesn't have to mean anything.  Indeed, with
suitable web server configuration, there oughtn't need to be a suffix.
 Indeed, with a suitably sophisticated configuration, it ought to be
possible for the web browser to tell something of its capabilities and
for the web server to, when asked for
http://linuxdatabases.info/info/slony, the most suitable form for your
web browser.  That might even be as a PDF file.

The article about URIs presents a pretty good case for having the
outside world's perspective on your URIs be Very Simple, and not
necessarily identical to the names of the files that sit on your
server.
-- 
http://linuxdatabases.info/info/slony.html
"The true  measure of a  man is how he treats  someone who can  do him
absolutely no good." -- Samuel Johnson, lexicographer (1709-1784)
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list