I have a PHP script in some directory. When I call it from the command line, getcwd(), __DIR__
and exec("pwd") return the directory of the script itself, not pwd.
E.g. calling /some/place/test.php from /tmp:
echo(getcwd()); // prints /some/place
echo(exec("pwd")); // prints /some/place
echo(__DIR__); // prints /some/place
echo($_SERVER["PWD"]); // prints /tmp
$_SERVER["PWD"] has the value that I need, but it's not mentioned in docs http://php.net/manual/en/reserved.variables.server.php