you can try:
$_SERVER['PATH_TRANSLATED']
quote:
Filesystem- (not document root-) based path to the current script, after the server has done any virtual-to-real mapping. Note: As of PHP 4.3.2,
PATH_TRANSLATED
is no longer set implicitly under the Apache 2 SAPI in contrast to the situation in Apache 1, where it's set to the same value as theSCRIPT_FILENAME
server variable when it's not populated by Apache.
This change was made to comply with the CGI specification that PATH_TRANSLATED should only exist ifPATH_INFO
is defined. Apache 2 users may useAcceptPathInfo = On
insidehttpd.conf
to definePATH_INFO
source: php.net/manual