Get Current Working Directory of Php Script/Application


$myPath = realpath(dirname(__FILE__));

or

$myPath = getcwd();