• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A PHP Error was encountered Severity: Warning Message: Cannot modify header

#1
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home1/grupoye1/public_html/teste/gestor/application/core/MY_Loader.php:1)

Filename: libraries/Session.php

Line Number: 687


I use xampp, as test server running on my computer.
in xampp this error does not occur!
This error only occurs on my server online, and I have no idea what might be.
someone help me?
Reply

#2
I would hazard a guess and say that you have called session_start() in your index.php file. Try searching for session_start() in your project.

A work-around is to modify the following file:

CodeIgniter_RCS/system/libraries/Session/Session.php

PHP Code:
// John added to try and see where the session_start() was already started
 
  if( isset($_SESSION) ) {
    
// $TMP = $this->uri->uri_string(); // PROBLEM
    
$TMP $_SERVER['REQUEST_URI'];
    
log_message('error''Session.php ALREADY STARTED: ' .$TMP); 

 
  }else{    
    
session_start();

 
  }//endif;            

 
  // ORIGINAL SCRIPT
 
    // session_start(); 
Reply

#3
(03-02-2015, 12:45 PM)gilfurtado Wrote: A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home1/grupoye1/public_html/teste/gestor/application/core/MY_Loader.php:1)

Filename: libraries/Session.php

Line Number: 687


I use xampp, as test server running on my computer.
in xampp this error does not occur!
This error only occurs on my server online, and I have no idea what might be.
someone help me?

You probably have error reporting turned off on your local environment and that's why you don't see the warning.

(03-29-2015, 09:37 AM)John_Betong Wrote: I would hazard a guess and say that you have called session_start() in your index.php file. Try searching for session_start() in your project.

A work-around is to modify the following file:

CodeIgniter_RCS/system/libraries/Session/Session.php


PHP Code:
// John added to try and see where the session_start() was already started
 
  if( isset($_SESSION) ) {
    
// $TMP = $this->uri->uri_string(); // PROBLEM
    
$TMP $_SERVER['REQUEST_URI'];
    
log_message('error''Session.php ALREADY STARTED: ' .$TMP); 

 
  }else{    
    
session_start();

 
  }//endif;            

 
  // ORIGINAL SCRIPT
 
    // session_start(); 

DO NOT EVER suggest for a user to modify a file under system/.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.