Uncaught think\exception\ErrorException: ob_end_clean(): failed to delete buffer. No buffer to dele

网友投稿 707 2022-11-27

Uncaught think\exception\ErrorException: ob_end_clean(): failed to delete buffer. No buffer to dele

Uncaught think\exception\ErrorException: ob_end_clean(): failed to delete buffer. No buffer to dele

配置swoole4.0结合thinphp5.1中返回错误  Uncaught think\exception\ErrorException: ob_end_clean(): failed to delete buffer. No buffer to dele

if (ob_get_length()) ob_end_clean();

该错误只是告诉您没有要删除的缓冲区。为了避免它只是使用:

if (ob_get_contents()) ob_end_clean();

(检查是否有活动输出缓冲区)或:

if (ob_get_length()) ob_end_clean();

(按照@Venu的建议检查缓冲区中是否存在非空字符串)。

你也在​​ob_end_clean();​​那里打了两次电话。这只适用于可堆叠缓冲区。从PHP手册:

此函数丢弃最顶层输出缓冲区的内容并 关闭此输出缓冲。

你确定你不想只使用​​ob_clean()​​吗?

建议

if(ob_get_length() > 0) { ob_clean();}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:PHP的in_array数组 第三个参数true/false
下一篇:浅谈为什么重写equals()就要重写hashCode()
相关文章

 发表评论

暂时没有评论,来抢沙发吧~