php离开页面吗,用户离开页面后,php执行是否停止?

这取决于。

When a PHP script is running normally

the NORMAL state, is active. If the

remote client disconnects the ABORTED

state flag is turned on. A remote

client disconnect is usually caused by

the user hitting his STOP button.

You can decide whether or not you want

a client disconnect to cause your

script to be aborted. Sometimes it is

handy to always have your scripts run

to completion even if there is no

remote browser receiving the output.

The default behaviour is however for

your script to be aborted when the

remote client disconnects. This

behaviour can be set via the

ignore_user_abort php.ini directive as

well as through the corresponding

php_value ignore_user_abort Apache

httpd.conf directive or with the

ignore_user_abort() function.

这似乎说,你的问题的答案是“是的,脚本将终止,如果用户离开页面”。

复杂的事情即使你发出了定期调用flush(),output buffering打开会导致这些调用陷阱,不会将它们发送到客户端,直到脚本完成!

更复杂的事情是,如果您安装了缓冲响应(例如mod_gzip)的Apache处理程序,然后再次php将不会检测到连接已关闭,脚本将继续卡车。

。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值