Jump to content

Warning session start line 1


alejandro52
 Share

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
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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.