错误不会出现?

时间:2012-11-10 19:13:53

标签: php html apache

  

可能重复:
  PHP doesn’t show any kind of errors

我不知道为什么,但是当我测试这段代码时:

<html>
<?php
header('Location: http://www.example.com/');
?>

我没有得到任何错误,例如“已发送的标题”,我应该这样做。 任何想法错误都不会出现的想法?

我在Windows 7上使用Apache 我有“error_reporting = E_ALL | E_STRICT”&amp; “display_errors = On”

1 个答案:

答案 0 :(得分:1)

输出缓冲可以自动打开。在这种情况下,在您的情况下不会向您报告错误。使用 ob_get_level

进行检查
<?php
    echo ob_get_level() //at the beginning of your script.
    ...
    ...
?>

如果启用了php.ini指令 output_buffering ,您将获得1作为返回值。