Search code examples
phpsuperglobals

$_SERVER['document_root']?


is this pointing to the directory where the current file is executed?


Solution

  • No, it points to the root of your webserver - the topmost folder of your website.

    If you want the directory of the current file, use:

    dirname(__FILE__);