php files not recognized in browser

Alex Maynard amaynard-vQ8rsROW2HJSpjfjxSPG1fd9D2ou9A/h at public.gmane.org
Fri May 13 14:32:26 UTC 2005



On Fri, 13 May 2005, Chris F.A. Johnson wrote:

>     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.


Thank you. I tried this. At least I get a different error now. I'm not
sure if I'm doing this correctly. I used mkdir to add a
public_html directory in home user directory (do I need to do something
fancier or put this somewhere else?) The permissions are:
drwxr-xr-x    2 amaynard amaynard      112 May 13 09:57 public_html/

Then I copied the php file into this directory, with permissions:
-rw-rw-r--    1 amaynard amaynard      111 May 12 19:28 hello.php

The I pointed the browser to  http://localhost/~amaynard/php/hello.php
but got a permission error this time (different from what I had before):

Forbidden

You don't have permission to access /~amaynard/php/hello.php on this
server.

Additionally, a 403 Forbidden error was encountered while trying to use an
ErrorDocument to handle the request.
Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7d PHP/5.0.4 DAV/2
mod_perl/1.999.21 Perl/v5.8.6 Server at localhost Port 80

Am I setting up the public_html in the wrong way/place?

Alex


> --
>      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
>





--
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