免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5867 | 回复: 3
打印 上一主题 下一主题

错误求助!ob_end_flush(): failed to delete and flush buffer. [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-05-29 12:18 |只看该作者 |倒序浏览
本帖最后由 joker_buggy 于 2013-05-29 14:28 编辑

报错:
[error] PHP Notice:  ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in /var/www/html/shindig/src/common/HttpServlet.php on line 81, referer: http://*********

代码:
public function __destruct() {
    if (! $this->noHeaders) {
      header("Content-Type: $this->contentType" . (! empty($this->charset) ? "; charset={$this->charset}" : ''));
      header('Accept-Ranges: bytes');
      if ($this->noCache) {
        header("Cache-Control: no-cache, must-revalidate", true);
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT", true);
      } else {
        
        header('Cache-Control: public,max-age=' . $this->cacheTime, true);
        header("Expires: " . gmdate("D, d M Y H:i:s", time() + $this->cacheTime) . " GMT", true);
      
        if (! isset($_SERVER['HTTP_PRAGMA']) || ! strstr(strtolower($_SERVER['HTTP_PRAGMA']), 'no-cache') && (! isset($_SERVE
R['HTTP_CACHE_CONTROL']) || ! strstr(strtolower($_SERVER['HTTP_CACHE_CONTROL']), 'no-cache'))) {
          if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $this->lastModified && ! isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
            $if_modified_since = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
            if ($this->lastModified <= $if_modified_since) {
              header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $this->lastModified) . ' GMT', true);
              header("HTTP/1.1 304 Not Modified", true);
              header('Content-Length: 0', true);
              ob_end_clean();
              die();
            }
          }
          header('Last-Modified: ' . gmdate('D, d M Y H:i:s', ($this->lastModified ? $this->lastModified : time())) . ' GMT',
true);
        }
      }
    }
    else {
      ob_end_flush(); 《=============================================出错位置的代码,请问这该怎么修改?
    }
  }

请问该如何修改,本人没搞过php,特来求助

论坛徽章:
0
3 [报告]
发表于 2013-05-29 17:59 |只看该作者
回复 2# xinglu1983


    OK了,查了很多地方
    修改成了
while (ob_get_level() > 0) {
            ob_end_flush();
        }

    报错就没了

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:55:28
2 [报告]
发表于 2013-05-29 14:54 |只看该作者
没有ob_start

论坛徽章:
0
4 [报告]
发表于 2013-05-30 10:17 |只看该作者
ob_start 还可以嵌套着玩啊。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP