IIS下flush连续输出无效的解决方案

2020-10-19 01:40:09 3379 阅读 开发实例与经验 #flush#php

在IIS下,部分机器使用PHP中的flush效果无效。

在保障输出字符达到浏览器输出量的前提下(str_repeat(" ", 4096) 或 str_pad('',1024) 填充字符量),需要修改applicationHost.config文件设置。

打开该文件路径为:

 C:/Windows/System32/inetsrv/config/applicationHost.config

搜索关键词:path="*.php"

找到诸如

在add这段后面加入:

responseBufferLimit="0"

即:

即可使flush效果有效,实现打字机、循序输出等缓存互动效果。