Usage of ob_start() to avoid "header already sent" error |
[eluser]goFrendiAsgard[/eluser]
In my application, I can ensure that there is no such a "un-intentional" whitespace or whatever. I don't perform "echo" at controller or model, but there is always "header already sent" error on the log file (Nothing shown in browser). PS: I load session and input library at both, the model and the controller This is actually not a big problem, but the error become terrible if I use CLI request. After browsing a while, I find this answer at stack overflow: http://stackoverflow.com/a/13783368/755319 It said that I can add ob_start() for output buffering at the beginning of index.php Code: <?php Is is save to do such a thing?
[eluser]TheFuzzy0ne[/eluser]
Does it not tell you where the headers were sent? You can safely omit the closing PHP tag at the end of a file to avoid this situation.
[eluser]goFrendiAsgard[/eluser]
Okay, BTW this is the solution: http://stackoverflow.com/a/15272229/755319 |
Welcome Guest, Not a member yet? Register Sign In |