How do I close a connection early?

前端 未结 19 1856
情书的邮戳
情书的邮戳 2020-11-22 04:24

I\'m attempting to do an AJAX call (via JQuery) that will initiate a fairly long process. I\'d like the script to simply send a response indicating that the process has star

19条回答
  •  清歌不尽
    2020-11-22 04:58

    A better solution is to fork a background process. It is fairly straight forward on unix/linux:

    /dev/null &");
    ?>
    

    You should look at this question for better examples:

    PHP execute a background process

提交回复
热议问题