views:

77

answers:

7

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

A: 

'DOCUMENT_ROOT'
The document root directory under which the current script is executing, as defined in the server's configuration file.

http://www.php.net/manual/en/reserved.variables.server.php

ILMV
you're contradicting yourself
SilentGhost
A: 

The document root directory under which the current script is executing, as defined in the server's configuration file.

as the name implies it's a root directory.

SilentGhost
+1  A: 

From http://php.net/manual/en/reserved.variables.server.php

'DOCUMENT_ROOT' The document root directory under which the current script is executing, as defined in the server's configuration file.

rogeriopvl
A: 

Yes it is. It's a path relative to the root of your server (not your document root) that describes the directory of the current script. It does not have a trailing slash.

mattbasta
+1  A: 

Maybe, depending on how the server is set up. A much better method is:

echo dirname(__FILE__); // return the absolute file-path to where the current PHP file is
Extrakun
+1: This is the correct way to do it.
R. Bemrose
+3  A: 

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__);

adam
+1: This is the correct way to do it. (I realize I posted this twice, but the two answers mentioning this solution were literally posted 1 second apart... 49 and 50 seconds before I loaded this page)
R. Bemrose
A: 

No, it's not,

DOCUMENT_ROOT points to the root directory of your webserver, while PATH_INFO points to the directory where the current file is executed.

Harmen