Hi,
I'm running a PHP script from a shell (bash, ...) - not from a web
server.
So I use a script of the form:
#!/usr/bin/php
<?php
var_dump($argv);
?>
and then I can run the script directly, rather than:
[user]# php -f script_name
Running the script this way changes the current directory to that of
the script.
I don't want this behaviour - I want the current directory to be from
where I run the script, so I can write the PHP code to work on 'local'
files (./*) - just like it should for CLI SAPI interface.
I can't use the -C option (PHP throws an error) like:
#!/usr/bin/php -q -C
Anyone know how to do what I want ?
System: Linux Fedora Core 1, PHP Version 4.3.8
Thanks,
John.