PHP 输出缓冲检查?
可能的重复:
PHP - 如何检测输出缓冲是否打开
如果output_buffering设置为On,我如何在PHP中检查?我必须对网站进行故障排除,但无法访问托管面板。
比如:
if(output_buffering == 'On')
{
echo 'It is On';
}
else
{
echo 'It is NOT On';
}
谢谢!
Possible Duplicate:
PHP - How Detect if Output Buffering is Turned On
How can I check in PHP if output_buffering is set to On? I have to troubleshoot a site and I have no access to the hosting panel.
Something like:
if(output_buffering == 'On')
{
echo 'It is On';
}
else
{
echo 'It is NOT On';
}
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
然而,它确实检查是否有活动的输出缓冲区,而不是 PHP 本身的实际设置。手动
ob_start()
(或多个)也会提高级别。通常这比实际的output_buffering
设置更有趣。如果您确实需要那个,请使用ini_get
答案。It does however check whether there is an output buffer active, not what the actual setting of PHP itself is. A manual
ob_start()
(or more then one) will also increase the level. Usually this is more interesting then the actualoutput_buffering
setting. If you actually need that, fo with theini_get
answer.您应该可以使用
ini_get()
< 来完成此操作/a>.我没有测试它,但我很确定它会满足您的需求,因为ini_get()
用于此目的:检查 php.ini 选项。You should be able to do this with
ini_get()
. I didn't test it, but I am pretty sure it will suit your needs sinceini_get()
is used for that purpose: checking php.ini options.