2008-10-28 46 views

回答

2

我真的知道的唯一方法是讓孩子分叉後,開闢出屬於自己的資源。

有上了pcntl一個相當不錯的教程在這裏:

http://hudzilla.org/phpwiki/index.php?title=Miscellaneous_topics

http://hudzilla.org/phpwiki/index.php?title=Duplication_of_resources_when_forking

+0

更新後的鏈接:http://www.hackingwithphp.com/16/0/0/miscellaneous-topics和http://www.hackingwithphp.com/16/1/4/duplication-of-resources-when-分叉 – Greg 2015-09-16 16:11:17

0

這爲我工作:

$cmd_to_run = escapeshellarg('/path/to/file --args'); 
`echo $cmd_to_run | /bin/at now`; 

替換「/路徑/到/文件 - -args'部分與你想運行的命令。 'at'命令使用你的cron守護進程來安排任務。

相關問題