WEB HOSTING $_SERVER['DOCUMENT_ROOT'] doesn't work on IIS
$_SERVER['DOCUMENT_ROOT'] doesn't work on IIS Article ID:204

This variable may not be present in IIS. Try the below work-around.

$DOCUMENT_ROOT = substr($_SERVER['PATH_TRANSLATED'],0,strlen($_SERVER['SCRIPT_NAME']) * - 1);
print($DOCUMENT_ROOT);

 

Downloads associated with this article:
  No downloads associated with this article
Back to Search or Browse