I execute a bash script from php with shell_exec. But the php script waits until the shell s开发者_开发百科cript is finished.
Can I somehow call the bash script without waiting. Both:
exec
shell_exec
are waiting until the bash script is finished. I'm running linux btw.
This has to work:
exec('/your/command /dev/null 2>/dev/null &');
when calling your bash script append & so it will run in the background that's the easiest way if you don't need any output
shell_exec("/bin/bash /path/to/script.sh &");
精彩评论