php的异步多进程

//test.php
for($i=0; $i<10; $i++){
    pclose(popen('php for.php &>>'.$i.'log &', 'r'));
}
//end

//for.php
ignore_user_abort(TRUE);//客户端断开脚本仍继续执行

for($i=0; $i<100; $i++){
    echo $i;
    sleep(1);
}
//end

写好上面两个脚本,执行test.php测试

转载请注明:小Y » php的异步多进程

赞 (0) 评论 (0) 分享 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址