RE: [PHP] document_root
| From: | John W. Holmes | Date: | Tue, 01 Oct 2002 23:24:58 +0000 |
| Subject: | RE: [PHP] document_root | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118459@lists.php.net to get a copy of this message | ||
OK. My bad. That's why I see DOCUMENT_ROOT on sourceforge is /var/www/,
while my scripts are in /home/groups/p/pr/project/htdocs/.
Sorry for causing confusion in the ranks. :)
So what the OP wants is dirname() ??
---John Holmes...
> -----Original Message-----
> From: Chris Shiflett [mailto:shiflett@php.net]
> Sent: Tuesday, October 01, 2002 6:39 PM
> To: holmes072000@charter.net
> Cc: 'Tony Crockford'; 'Php-General@Lists. Php. Net'
> Subject: Re: [PHP] document_root
>
> *cringe*
>
> No, document root is a defined directory, not an attribute of a
specific
> file. It is used to map the root URL to a directory on the filesystem.
>
> For example, when you request http://www.google.com/, that
> final slash
> in the URL is the resource you are requesting. In this case, it is the
> root URL for that domain, and everything branches off from that
> hierarchically.
>
> Document root is the filesystem directory that is equivalent to the
root
> URL and is used by the Web server to locate the requested resource.
> Thus, everything within this directory is (potentially, depending on
> permissions) accessible via a URL. For example, if the document root
for
> Google were /usr/local/apache/htdocs/, then the URL
> http://www.google.com/foo/bar/blah.php would be equivalent to
> /usr/local/apache/htdocs/foo/bar/blah.php on the filesystem.
>
> Hope that clarifies.
>
> Chris
>
> John W. Holmes wrote:
>
> >You want DOCUMENT_ROOT. If you have a file
> >
> >/home/groups/myproject/htdocs/file.php
> >
> >then, from within that file.php, DOCUMENT_ROOT is
> >
> >/home/groups/myproject/htdocs/
> >
> >I think it would be $_SERVER['DOCUMENT_ROOT'] in newer versions of
PHP.
> >