0

From a php script I need to launch a new php script in background. I expect this to be working:

shell_exec("php mySecondScript.php &");

Execution of main script hangs and secondScript is not even started. Of course if I remove '&' the script is executed, but synchronously. Any reason for this?

1
  • It does; unfortunatly i was not precise in following redirect syntax Commented May 31, 2020 at 7:45

1 Answer 1

0

You don't redirect output of command.

shell_exec("php mySecondScript.php > /dev/null &");
Sign up to request clarification or add additional context in comments.

1 Comment

Actually I was.. but using "&> myLogFile" it's not working. Using "> myLogFile 2>&1" it is. That was really hard to figure out, and still I wonder why

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.