PHP “Cannot send session cache limiter – headers already sent” error

July 22, 2008

I faced with this problem today, and Mr Google helped me to this site which helped me figure out how to solve the problem. Basically what the site says is “Make sure to check for and remove any spaces or carriage returns directly before or after your opening and closing php tags.” So for me, my problem is caused by this line:

==================================

<html><head><title>My Page</title></head>

<?PHP

include(“global.php”);
include(“adminAuth.php”);

?>

==================================

and to fix it, I simply put both the include lines at the uppermost, which becomes like this:

==================================

<?PHP

include(“global.php”);
include(“adminAuth.php”);

?>

<html><head><title>My Page</title></head>    <–see now the html code is brought down

==================================

Alhamdulillah, thank God the problem is solved just by doing this. Anyway this problem only surfaced when I uploaded my php code to my internet server. The same code doesn’t give any problem on my localhost server. Which I think I can conclude that the error will only appear on certain PHP/apache version.

Entry Filed under: Technology. Tags: , , .

2 Comments Add your own

  • 1. anonim  |  August 20, 2009 at 6:37 pm

    wish u luck !
    very good article you wrote, helps me solve my problem ! ^_^

    Reply
  • 2. Joe Aliferis  |  September 21, 2009 at 4:50 pm

    genius !

    thank you thank you thank you

    Reply

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

July 2008
M T W T F S S
« Apr   Aug »
 123456
78910111213
14151617181920
21222324252627
28293031  

Most Recent Posts