Archive

Posts Tagged ‘session’

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

July 22, 2008 6 comments

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.

Categories: Technology Tags: , ,