Jump to content

Warning session start line 1


alejandro52

Recommended Posts

I keep having the same problem when i run my script on the server. the error is

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/alliapop/public_html/ekloges2010/ekloges2010/eisagogi.php:1) in /home/alliapop/public_html/ekloges2010/ekloges2010/includes/session.php on line 1

I know i have to put session start at he very first line and i did but the problem keeps showing up. What else should i check?

Link to comment
https://forums.phpfreaks.com/topic/217925-warning-session-start-line-1/
Share on other sites

Your code won't work because you cannot output anything to the browser before a statement that uses a header, like a session_start(), a setcookie(), or a header() redirect.

 

If the BOM characters are the problem, you must either save the file as a UTF-8 encoded file without the BOM or you must save the file as a ANSI encoded file.

i just ran into this exact same problem yesterday, given an HTML file that I needed to add PHP to.

 

<?php as the very first item on the very first line, session_start() on the second line, but I still got the headers/session_start() warning.

 

As people are figuring out: I had to save the file as UTF-8 without BOM. The error then went away.

 

(FYI: I use BBEdit/Mac)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.