You can decide whether or not you want a client disconnect to cause
your script to be aborted.
根据PHP手册:Connection Handling
要设置此行为,请使用ignore_user_abort
客户端断开连接后,ignore_user_abort(FALSE);将中止PHP脚本的运行.
ignore_user_abort(TRUE);将忽略客户端断开连接并继续运行脚本.
在第二种情况下,您可能还希望根据需要使用set_time_limit,以便为脚本提供足够的时间来完成任务.
此设置已成功在PHP-FPM / nginx环境中进行了测试.