![]() |
Cannot modify header information - headers already sent by (output started at C:wampwwwappcoreMY_Controller.php:1) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Cannot modify header information - headers already sent by (output started at C:wampwwwappcoreMY_Controller.php:1) (/showthread.php?tid=57940) |
Cannot modify header information - headers already sent by (output started at C:wampwwwappcoreMY_Controller.php:1) - El Forum - 04-28-2013 [eluser]cobolCowboy[/eluser] Hello, Thanks to this framework I've been able to learn some PHP and OOP after three decades of linear COBOL programming. Thanks for that. I looked for an answer to this but to no avail. I'm running a WAMP server, using PHP 5.3.10 and CI 2.1.3 MY_Controller, in the error text, which lives in app\core\MY_Controller.php looks like this... Code: <?php I did this so that any page that requires being logged in will extend this controller instead of CI_Controller, but the weirdest part is that I have not yet extended this controller anywhere ?! The full text of the error is this... Quote:A PHP Error was encountered Considering that I have not overridden the session library, then I'm lead to believe that this must be pointing to sys\libraries\session.php. Line 676 points directly to the setcookie statement... Code: setcookie( And once you do that, you can't then later send out browser content without getting this "severe" type error. I commented this statement and the error went away. But then a cookie doesn't get set. What's the ramifications of that? How do we solve this problem? Cannot modify header information - headers already sent by (output started at C:wampwwwappcoreMY_Controller.php:1) - El Forum - 04-28-2013 [eluser]Aeisor[/eluser] Have you saved this file (MY_Controller.php) with an invalid UTF-8 BOM, or with a new line before the "<?php"? Try saving it as DOS encoding. |