The setup:
On a Mac OS X 10.5.8, with the original Apache 2.2, where the only change is to uncomment
LoadModule php5_module
In the _DocumentRoot_
dir, /Library/Webserver/Documents/
, in a file named info.php
, write:
<? php phpinfo(); ?>
The problem:
Request http://localhost/info.php
and the response is the output from the function (i.e. PHP executed the file).
However, request from domain 127.0.0.1
or 192.168.1.x
and the response is the content of the file, w/ a header of Content-Type application/x-httpd-php
.
The file is always found via the request, so it's not a hosts mapping problem. However, it's treated as an executable only when the request is for domain localhost. There are no virtual hosts set up in the apache conf, so I figure the behaviour should be the same regardless of the domain.
Any idea how to remedy this so that I could use this server on my LAN?
Thanks.