2012-11-10 46 views
0

可能重複:
PHP doesn’t show any kind of errors錯誤不會顯示出來?

我不知道爲什麼,但是當我測試此代碼:

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

我不明白像「標題的任何錯誤已經發送「,我應該。 任何想法爲什麼錯誤不會顯示?

我使用Apache在Windows 7 我有 「的error_reporting = E_ALL | E_STRICT」 & 「的display_errors =在」

+3

(1)'phpinfo();'認爲它在? (2)您可能會自動輸出緩衝,在這種情況下,這不會導致錯誤。 – Wrikken

回答

1

輸出緩衝可以自動開啓。在這種情況下,您的情況將不會向您報告錯誤。檢查使用ob_get_level

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

如果php.ini指令output_buffering開啓時,您將獲得1作爲返回值。

+0

好THX,我已經關閉了output_buffering和現在的工作:-) – Mulligan

+0

現在我有這樣的代碼問題: – Mulligan