【问题标题】:What does this mean? "Notice: ob_flush() [ref.outcontrol]: failed to flush buffer zlib output compression"这是什么意思? “注意:ob_flush() [ref.outcontrol]: 刷新缓冲区 zlib 输出压缩失败”
【发布时间】:2012-02-19 20:59:08
【问题描述】:

运行以下函数后出现此错误:

function send_buffer(){
  ob_end_flush(); 
  ob_flush(); 
  flush(); 
  ob_start();
}

我网站的主体需要几秒钟才能加载,所以我想先发送标题。但我收到以下错误:Notice: ob_flush() [ref.outcontrol]: failed to flush buffer zlib output compression

【问题讨论】:

    标签: php buffer


    【解决方案1】:

    您不能使用 gzip/zlib 压缩以及刷新。

    二选一。我建议使用 gzip 而不是 flush。

    【讨论】:

    • 可以将 gzip/zlib 与 flush 甚至 ob_flush 一起使用。不过这很棘手。 ob_flush 需要对其内容进行刷新的测试(if (ob_get_length()) {ob_flush();}),并且您无法调整 ob_start() 和 ob_flush() 之间的 zlib.output_compression。在这些限制范围内,我将 flush 和 ob_flush 与两个 Apache 配置一起使用。
    猜你喜欢
    • 2016-12-06
    • 2012-02-29
    • 2021-11-19
    • 2013-02-09
    • 2010-10-13
    • 2013-08-08
    • 2011-11-12
    • 2020-01-20
    相关资源
    最近更新 更多