Ryan,

> Anyone know how to get the script path (not the current working directory,
> but the actual path of the executing script) of a commandline script?
>
> I've dug through the docs and can't find this anywhere. None of the
> typical $_SERVER variables return the script path (although several of
> them return the filename, hooray for redundancy). The docs say several
> times that getcwd() will NOT return the path of the executing script, but
> they don't mention how to get it.


_SERVER["argv"] [ 0 ] gives the full path to the script (including the
script's name and filetype)

=dn

PS if you want to know more, run the standard PHPINFO() through the command
line, piping to an output.HTML file, then drop that into your browser!


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

Reply via email to