0

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent on line 2

I searched on every questions. I see the solve putting this on the top of the page.

I did:

<?php session_start();?>

got the same error. Can someone help?

gen_Eric
  • 214,658
  • 40
  • 293
  • 332

2 Answers2

2

Cannot send session cache limiter - headers already sent

Always means that you have printed some content before. Check if there is no HTML code or any other echo`ed text.

hsz
  • 143,040
  • 58
  • 252
  • 308
1

You should be generous to yourself and provide the information where the output started:

<?php    

if (headers_sent($filename, $linenum)) {
    trigger_error("Headers already sent in $filename on line $linenum", E_USER_ERROR);
} 

session_start();

?>

That should give you more information to easier troubleshoot the problem.

And the best book on Stackoverflow for that error message is:

Community
  • 1
  • 1
M8R-1jmw5r
  • 4,676
  • 2
  • 17
  • 26