faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

9 of 25 people (36%) answered Yes
Recently 4 of 10 people (40%) answered Yes


How do I get the Windows NT $DOCUMENT_ROOT? The variable is blank.

Feb 24th, 2008 20:09
dman, Articles Way, Ayse Geertsma, Jay Jimenez, http://www.ttnr.org

Well, for starters, try to enter a value for doc_root in 
your "php.ini". If you didn't, the variable isn't empty, it just 
doesn't exist. If this doesn't solve it, try to use $HTTP_SERVER_VARS
['DOCUMENT_ROOT'] or, from PHP 4.1.0 $_SERVER['DOCUMENT_ROOT']. You 
should use the array-method anyway because this is preferred and it 
will make upgrading PHP later a lot less complicated.