Forum Moderators: coopster
I have setup my Apache and PHP on windows machine.
All the site folders are put under "htdocs". Now suppose I have a website called "business" i have put that under "htdocs/business"
I have a file test.php under business directory in which i have written code;
include ($DOCUMENT_ROOT."/include/config.php");
the result of above says no file found under c:/apache/htdocs/includes/config.php, while my file is under c:/apache/htdocs/business/includes/config.php
Now.. I am not sure if Dcoument root should be used here or not.. because it is showing the path of htdocs while all my sites arte in different directories.
Please suggest..
Regards
Now suppose I have a website called "business" i have put that under "htdocs/business"
:
Now.. I am not sure if Dcoument root should be used here or not.. because it is showing the path of htdocs while all my sites arte in different directories.
This looks like you really have just 1 website (the DOCUMENT_ROOT returns the directory of the root of your website as seen by the server), with several sub directories which you are calling websites. (Unless you are intending these to be sub domains?)
What I think you should be doing is actually setting up multiple websites (virtual hosts) on your web server, then DOCUMENT_ROOT will return the appropriate root directory depending on which site you are on...?
XAMPP/Apache for multiple websites [webmasterworld.com]