2011-05-26 75 views
9

可能重复:
Asynchronous shell exec in PHP
Is there a way to use shell_exec without waiting for the command to complete?了shell_exec无需等待输出

我想运行一个相当缓慢/复杂的程序,至少需要10分钟即可完成。我想通过shell_exec或类似的东西来调用它,但是我不想让php脚本等待这个程序的完成。

是我能做的事吗?如果是的话,我该怎么做?

+0

您可以使用任务https://github.com/jamm/Tasks模块 - 特供延迟执行,而无需等待,并且不使用' shell_exec'。或者你可以阅读这个答案:http://stackoverflow.com/questions/1019867/php-shell-execute-without-waiting-for-a-return/1019904#1019904 :) – 2011-05-26 14:22:20

+0

我完全不明白这一个 – nivanka 2011-05-26 14:27:23

+0

http: //stackoverflow.com/questions/45953/php-execute-a-background-process – ajreal 2011-05-26 14:28:47

回答