RE: [PHP] Document root, preferred way to find it???
| From: | Chris W. Parker | Date: | Wed, 02 Mar 2005 20:05:48 +0000 |
| Subject: | RE: [PHP] Document root, preferred way to find it??? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-209846@lists.php.net to get a copy of this message | ||
Al <mailto:news@ridersite.org>
on Wednesday, March 02, 2005 11:22 AM said:
> I've been using in my scripts $_SERVER['DOCUMENT_ROOT'] to find the
> base path for includes, etc.
>
> We just moved the site to a new virtual host and it doesn't work.
> print_r() gives me:
>
>> $_SERVER['document_root']= /usr/local/apache/htdocs
>> $_SERVER['path_translated']= /home/user/public_html/
>
> What do you guys use for you docroot?
One option is to set your own:
<?php
$APP['document_root'] = '/wherever/you/want';
?>
hth,
Chris.