For versions of PHP < 5.5.0, you can get the name of the script from $argv[0]: http://www.php.net/manual/en/reserved.variables.argv.php