This question has already been answered:

Hello. There was such a problem, from time to time, an error appears on the Code Igniter framework:

Message: Cannot modify header information - headers already by (output started at c: \ ... \ main.php: 1)

Tell me how to fix, the error appears only sometimes, I checked the spaces on different encodings - they are not there. The error also appears after writing the values ​​to the Session class.

Reported as a duplicate by ReinRaus , AK , Vadim Ovchinnikov , Alex , user194374 participants on Jan 6 '17 at 7:09 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

1 answer 1

Everywhere, check for invisible characters and at the end of your php files, remove the closing tag?>. First do this with inclusive views.