Click to See Complete Forum and Search --> : $document_root


donnierivera
09-13-2002, 03:48 PM
What do I have to configure to get $DOCUMENT_ROOT or $_SERVER["DOCUMENT_ROOT"] to work on UNIX. $_SERVER["DOCUMENT_ROOT"] works on my devel box, but not the prod UNIX box.. I have set to:

include_path = ".:/php/includes:/docnet/web;."

But it doesn't seem to have an effect. I am so lost?

bealers
09-13-2002, 08:03 PM
My understanding is that DOCUMENT_ROOT is a webserver Variable and has nothing to do with PHP

if I'm on a machine running apache and in the VirtualHost container the DocumentRoot is set to /home/foo then i'd expect DOCUMENT_ROOT to display that..hove you tried $_ENV just in case?

donnierivera
09-14-2002, 10:16 AM
Forgot I put it in two places: GOT IT! 1) Need to add my root dir to php.ini include_path =".:/php/includes:/docnet/web;." 2) Which took me forever to figure out? When calling $DOCUMENT_ROOT in a function. You must make it global. hmm... Don't quit understand since it is a system variable, but I guess it makes since because I called it in a function. Hope this helps someone from lack documentation (at least I couldn’t find any other than forum questions and responses) on $DOCUMENT_ROOT and how to set the value…