2011-05-26 41 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

回答