Page 1 of 1

$_SERVER['DOCUMENT_ROOT'] and / , difference

Posted: Fri Mar 05, 2010 8:31 am
by klevis miho
What is the difference between using $_SERVER['DOCUMENT_ROOT'] and just '/' ?

Re: $_SERVER['DOCUMENT_ROOT'] and / , difference

Posted: Fri Mar 05, 2010 9:25 am
by Weirdan
$_SERVER['DOCUMENT_ROOT'] stores filesystem location where '/' for this specific domain points to. So if you're site resides in /var/www/example.com $_SERVER['DOCUMENT_ROOT'] would give you exactly that, while to access it from browser you would use http://example.com/

Re: $_SERVER['DOCUMENT_ROOT'] and / , difference

Posted: Fri Mar 05, 2010 9:53 am
by klevis miho
Thnx