Cannot modify header information - headers already sent

From Php

Jump to: navigation, search

You can get messages like this:

  Warning: Cannot modify header information - headers already sent by (output started at foo.php:42) in bar.php on line 711

in a number of different ways, but it means that either your program should not have written output at one of the two referenced lines (either foo.php:42 or bar.php:711).

One very difficult thing to detect is a blank line AFTER your "?>". Anything after the "?>" is printed to the browser, and that includes blank lines. So make sure you have NOTHING after your "?>" if you get this error.

See Also

Personal tools