PHP “Cannot modify header information – headers already sent”: 6 Causes and Fixes (Tested)
PHP’s ‘Cannot modify header information – headers already sent’ warning means something was output before header() or session_start(). How to read ‘output started at’, and fixes for spaces, BOMs, echo, closing tags, includes and output buffering. Tested.