This works (3 back, not 2)
This does not work
The script happens to be in a subdomain and $SERVER['DOCUMENTROOT'] returns
which is in the public directory, not the root. In the main domain it would return
not too reliable.
Much neglected FILE, on the other hand, returns
which is better but still no help.
I'm sticking with absolute path
EDIT - This also works:
$path = $_SERVER['DOCUMENT_ROOT'];
$pos = strpos($path, 'public_html');
$path = substr($path, 0, $pos).'php';