Jump to content

Command Line PHP - 2 Questions


jvalarta

Recommended Posts

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=blah




QUESTION 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?
Link to comment
Share on other sites

myscript.php?f00=1&bar=2&etc=blah

No 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 correctly

i'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...


regards
Liam
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.