2014年9月11日 星期四

php 執行背景程序

For windows:
pclose(popen("start php.exe test.php","r"));

For linux:
pclose(popen("php test.php &","r"));


或者如果沒有開權限給給pclose這個函數,可另外使用系統排程來執行。

參考網址
http://stackoverflow.com/questions/8910055/executing-an-exec-or-system-in-php-and-do-not-wait-for-output

沒有留言:

張貼留言