jvalarta Posted August 21, 2006 Share Posted August 21, 2006 QUESTION 1:Q-- Is it possible to append GET variables to a PHP string via command line? I can not get this to work:> myscript.php?f00=1&bar=2&etc=blahQUESTION 2:When I start a PHP script via command line, it runs fine, until I close the terminal window (then it dies). If I do this, it returns a prompt, but still dies if I close the terminal window:> myscript.php &Q-- How can I start a PHP script to run and then be able to close the terminal window and have it continue to execute? Quote Link to comment https://forums.phpfreaks.com/topic/18202-command-line-php-2-questions/ Share on other sites More sharing options...
shocker-z Posted August 21, 2006 Share Posted August 21, 2006 myscript.php?f00=1&bar=2&etc=blahNo it doesnt work from my knolledge as the $_GET is used in conjuntion with the webserver and running from command line it wouldnt pass them correctlyi've seen that from a php file you can launch like this exec("php $path $param > /dev/null &");but not sure if php $path $param > /dev/null & will work from command line aloan...regardsLiam Quote Link to comment https://forums.phpfreaks.com/topic/18202-command-line-php-2-questions/#findComment-78216 Share on other sites More sharing options...
jvalarta Posted August 21, 2006 Author Share Posted August 21, 2006 Ok, I see. I could use exec() but I don't quite understand the syntax. I went to php.net/exec but that's no clearer. Can you explain how I say foo=bar&etc=blah using exec? Quote Link to comment https://forums.phpfreaks.com/topic/18202-command-line-php-2-questions/#findComment-78264 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.