Pages

Search This Blog

Friday, September 26, 2014

Cannot modify header information - headers already sent by

Facing error when try to use codeigniter and the page won't redirect after update / edit

 A PHP Error was encountered

    Severity: Warning

    Message: Cannot modify header information - headers already sent by (output started at xxxxx:1)

    Filename: libraries/Session.php

    Line Number: 675
 A PHP Error was encountered

    Severity: Warning

    Message: Cannot modify header information - headers already sent by (output started at xxxxx:1)

    Filename: helpers/url_helper.php

    Line Number: 542

How to solve my issue?

open index.php and add ob_start();  like below

ob_start();

/*
 *---------------------------------------------------------------
 * APPLICATION ENVIRONMENT
 *---------------------------------------------------------------
 *
 * You can load different configurations depending on your
 * current environment. Setting the environment also influences
 * things like logging and error reporting.
 *
 * This can be set to anything, but default usage is:
 *
 *     development
 *     testing
 *     production
 *
 * NOTE: If you change these, also change the error_reporting() code below
 *
 */

No comments: