On Tue, 2002-02-12 at 13:44, Alex Shi wrote:
> Hi,
> 
> I have a script need to be launched from terminal, and I want
> it to report the script's path. Because this script is required to
> be launched from command line, so those Apache env vars
> have not effect work, even $PHP_SELF don't work. 
> Can anybody has a solution for this? Thanks in advance for
> any answers!
> 
> Regards,
> 
> Alex

One way to do it:

#!/usr/local/bin/php -q
<?php
error_reporting(E_ALL);

$path_to_me = getcwd() . '/' . basename($argv[0]);
echo $path_to_me;
?>


Hope this helps,

Torben

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to