php files not recognized in browser

Chris F.A. Johnson cfaj-uVmiyxGBW52XDw4h08c5KA at public.gmane.org
Fri May 13 13:23:45 UTC 2005


On Fri, 13 May 2005, William O'Higgins wrote:

> Other respondents have been telling you that it is apache that should be
> interpreting PHP files, so that's covered.  Things to look for:
>
> In httpd.conf:
>
> DirectoryIndex index.html index.htm index.php
>                                    ^^^^^^^^^
> Remind the server that these files are acceptable as index files when a
> directory is requested.
>
> In modules.conf:
>
> LoadModule php?_module /path/to/libphp?
>
> That's all I ever had to do.

    But that will not help if the URL is entered in the browser as:
    /home/amaynard/share/private_html/php/hello.php. The browser will
    read the file directly and not use the web server.

    The correct way to have Apache interpret the file is to put it in
    your public_html directory (if that's how you have Apache set up)
    and call it as: http://localhost/~amaynard/php/hello.php.

    I went through a similar situation with shtml files. When I put the
    files on a remote server, everything was fine. When I accessed it
    locally, the file was empty; all the contant was in included files.
    Once I used http:, all was fine.

-- 
     Chris F.A. Johnson                     <http://cfaj.freeshell.org>
     ==================================================================
     Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
     <http://www.torfree.net/~chris/books/ssr.html>
--
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