0

Possible Duplicate:
PHP doesn’t show any kind of errors

I don't know why but when i test this code:

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

I don't get any errors like "headers already sent" which i should. Any ideas why the error won't show up?

I'm using Apache on Windows 7 I have "error_reporting = E_ALL | E_STRICT" & "display_errors = On"

Community
  • 1
  • 1
Mulligan
  • 81
  • 1
  • 1
  • 8
  • 3
    (1) does `phpinfo();` think it's on? (2) you may have automatic output buffering on, in which case this won't cause an error. – Wrikken Nov 10 '12 at 19:15

1 Answers1

1

Output buffering could be turned on automatically. In that case, an error won't be reported to you in your case. Check using ob_get_level

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

If the php.ini directive output_buffering is turned on, you'll get 1 as the return value.

Anirudh Ramanathan
  • 46,179
  • 22
  • 132
  • 191