PHP auto-kill a script if the HTTP request is cancelled/closed

后端 未结 4 539
日久生厌
日久生厌 2020-12-01 15:11

The problem is that for a long process the PHP script keeps on executing whether or not the client browser is currently connected or not. Is there any possibility that if th

4条回答
  •  伪装坚强ぢ
    2020-12-01 15:27

    This is what you're looking for: http://php.net/manual/en/function.ignore-user-abort.php

    Stopping a script in the middle of execution can lead to unexpected results, so caveat emptor

提交回复
热议问题