How do I close a connection early?

前端 未结 19 1884
情书的邮戳
情书的邮戳 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 05:04

    An alternative solution is to add the job to a queue and make a cron script which checks for new jobs and runs them.

    I had to do it that way recently to circumvent limits imposed by a shared host - exec() et al was disabled for PHP run by the webserver but could run in a shell script.

提交回复
热议问题