Warning: include() [function.include]: open_basedir restriction in effect. File(/home/toknowmo/public_html/configs.php) is not within the allowed path(s): (/home/migrate.a2/web:/home/ezee4040:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/ezee4040/public_html/toknowmore.net/e/1/php/script-filename.php on line 2

Warning: include(/home/toknowmo/public_html/configs.php) [function.include]: failed to open stream: Operation not permitted in /home/ezee4040/public_html/toknowmore.net/e/1/php/script-filename.php on line 2

Warning: include() [function.include]: Failed opening '/home/toknowmo/public_html/configs.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ezee4040/public_html/toknowmore.net/e/1/php/script-filename.php on line 2
PHP: $_SERVER['SCRIPT_FILENAME']

$_SERVER['SCRIPT_FILENAME']

The $_SERVER['SCRIPT_FILENAME'] variable gives you the absolute path of the script that is executing.

Use as follows:

echo $_SERVER['SCRIPT_FILENAME'];

Example of possible output:

/home/funsites/public_html/e/1/php/script-filename.php

See also:

$_SERVER['HTTP_REFERER']
$_SERVER['HTTP_USER_AGENT']
$_SERVER['REMOTE_ADDR']
$_SERVER['PHP_SELF']
$_SERVER['REQUEST_URI']
$_SERVER['DOCUMENT_ROOT']
$_SERVER['HTTP_HOST']
$_SERVER['QUERY_STRING']