"Cannot modify header information - headers already sent" in PHP — What It Means and How to Fix It

What the PHP error "Cannot modify header information - headers already sent" means and how to fix it.

Published November 1, 2026

"Cannot modify header information - headers already sent" the full form of the "headers already sent" error, specifically about header() or setcookie() calls.

Key points

  • Check for a BOM (byte order mark) or trailing whitespace at the end of included files, a common hidden cause
More PHP articles