0

Hopefully a quick question. I have a .sh script running a php script - the php takes some time to complete and I want the .sh script to proceed.

Is that possible? And if so, how so?

1 Answer 1

3

Have you tried php somescript.php & ? The & at the end causes the sh script to continue executing.

If you want the php script to outlive the shell script, try this:

nohup php somescript.php >/dev/null 2>&1 &
Sign up to request clarification or add additional context in comments.

7 Comments

Does the & do something there? Sorry I don't get it.
Yes, it causes the sh script to not wait for the php script to finish before continuing its execution
Sounds spot on, let me just see
Doesn't seem to work. Am I missing something: I'm doing: php -f /home/script.php $2 &
Try this: nohup php -f somescript.php >/dev/null 2>&1 &
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.