加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

取消对PHP页面的请求会发生什么?

发布时间:2020-12-13 17:27:09 所属栏目:PHP教程 来源:网络整理
导读:当一个长时间运行的 PHP文件正在执行,用户在浏览器中间取消页面请求时,其余脚本是否在服务器上运行? 一旦实现连接关闭,PHP通常会终止脚本执行: PHP will not detect that the user has aborted the connection until an attempt is made to send informati
当一个长时间运行的 PHP文件正在执行,用户在浏览器中间取消页面请求时,其余脚本是否在服务器上运行?
一旦实现连接关闭,PHP通常会终止脚本执行:

PHP will not detect that the user has aborted the connection until an
attempt is made to send information to the client. Simply using an
echo statement does not guarantee that information is sent,see
flush().

您可以使用ignore_user_abort()保持脚本运行.

此外,还有一个默认的时间限制允许哪些脚本运行.您可能想要使用set_time_limit()覆盖.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读