#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    50
    Rep Power
    15
    Dear Friends,
    I have just install PHP4, Apache1.3.12 and MySQL3.22.32.
    What i really am not able to figure out where to store my .php files
    should they be in the '/httpd' dir or could they also be in the '/<user>' directory.
    I tried putting them in '/<user>' dir......they didnt work..!!

    Does that mean i can only store them in '/httpd' dir.? And what bout the .html files should they go along with .php files in the '/httpd' dir or can they be put anywhere else also?? (espescially if some relation is there to .php files)

    cheers duke.
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    Your HTML files can go anywhwere - but if they are linked to a project with PHP files then it is easiest if they are all in the one place.

    PHP files will only work from the server root directory , in your case httpd you can however configure apache to use c: - or any directory as the server root if you wish, then php files anywhere below your root will work.

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  4. #3
  5. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    It should work anywhere under your DocumentRoot.
    You said "they didnt work..!!", so what exactly didn't work. Any error? It might be a wrong configuration of your httpd.conf file or your PHP simply didn't install successfully.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    35
    Rep Power
    15
    Have a look for either:

    /home/httpd/htdocs/

    or

    /www/htdocs

    or a line in your httpd.conf that specifies the DocumentRoot of your server.

    When you type in the address of your server apache maps it onto your filesystem, eg:
    http://www.website.com/path/to/file.html
    /home/httpd/htdocs/path/to/file.html

    You can load html pages from anywhere in your filesystem straight into your browser and they will render, PHP pages will not (they need to be parsed by apache/mod_php or cgi-php).

    It is wise to organise files into directories under the DocumentRoot in some kind of orderly fashion...

    HTH
    marty

  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    50
    Rep Power
    15
    I tried putting them in '/<user>' dir......they didnt work..!!
    -> this means that i put my .php files in /<user> lets say '/duke'

    so i have:
    /duke/a1.php
    /duke/a2.php

    and my apache directory is /home/httpd

    so if i run it saying:
    lynx http://localhost/a1.php

    this is what doesnt work...should i mention a directories in the PATH
    also how should i mention the PATH to the Apache 'httpd' to locate under the '/duke' or say any '/<user>'??

    duke
  10. #6
  11. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>how should i mention the PATH to the Apache 'httpd' to locate under the '/duke' or say any '/<user>'??
    Check your httpd.conf...

    ----------For normal users----------
    <IfModule mod_userdir.c>
    UserDir public_html
    </IfModule>

    Then let say ~duke (the home dir of duke) is /home/duke, you then need to create a directory called "public_html" under /home/duke, that is the web root for duke.

    Also have the following <Directory> block somewhere in your httpd.conf. Alter it accordingly.
    <Directory /home/*/public_html>
    AllowOverride All
    Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI Includes
    <Limit GET POST OPTIONS PROPFIND>
    Order allow,deny
    Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
    Order deny,allow
    Deny from all
    </LimitExcept>
    </Directory>

    ----------For your main web----------
    DocumentRoot "/home/httpd/htdocs" or anywhere on your file system like so...
    DocumentRoot "/data/myweb/anydir"

    Keep in mind, you don't necessary need to have /myweb/anydir, but it's recommended.

    There should be a default httpd.conf named "httpd.conf.default" you can begin with. Then rename it to httpd.conf and restart apache.

    Also, the URL for your user's web would be -> http://localhost/~username/

    [This message has been edited by freebsd (edited August 14, 2000).]

Similar Threads

  1. Help required with htm files downloading in browser
    By Wreck in forum HTML Programming
    Replies: 6
    Last Post: February 14th, 2004, 04:30 PM
  2. Reading files that has certain parrent at once
    By cgi_pro in forum Perl Programming
    Replies: 2
    Last Post: January 29th, 2004, 11:13 PM
  3. Replies: 0
    Last Post: January 21st, 2004, 04:11 PM
  4. Can't open certain .php files
    By smilingdog in forum PHP Development
    Replies: 1
    Last Post: January 13th, 2004, 09:34 PM
  5. Replies: 1
    Last Post: January 5th, 2004, 11:09 AM

IMN logo majestic logo threadwatch logo seochat tools logo