Re: Question about $DOCUMENT_ROOT and include

From: Date: Wed, 05 Feb 2003 17:45:50 +0000
Subject: Re: Question about $DOCUMENT_ROOT and include
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-134445@lists.php.net to get a copy of this message
Thanks for the feedback.... That works if I leave off the quotes from around DOCUMENT_ROOT. Simply $_SERVER[DOCUMENT_ROOT] I'd really like to get this working in the htaccess file. php_value include_dir ".:/www/r/myID/htdocs/" I redoing a site with several php files in assorted directories and would like be certain things will work if we move the site to a new host. Several references I've found suggest staying away from using $DOCUMENT_ROOT since it can be different on virtual hosts. Chris Shiflett wrote:
--- Al <news@ridersite.org> wrote:
Why does the absolute path work and not document_root? include ("$DOCUMENT_ROOT/root_functionsT.php"); //error message says function undefined include ("/www/r/myID/htdocs/root_functions.php"); // Works just fine
Try $_SERVER['DOCUMENT_ROOT'] and see if that works. Chris


« previous php.general (#134445) next »