开发者

execute bash script from php without waiting

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 &"); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜