dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Sessions warning since upgrading to php 5.5

  1. #1
    Join Date
    Feb 2012
    Posts
    102

    Sessions warning since upgrading to php 5.5

    I had been using php version 5.2 and everything was working fine but when I upgraded to version 5.5 I started getting a warning saying:


    Warning: session_start(): Cannot send session cache limiter - headers already sent

    This doesnt make any sense to me as I do not have any output prior to calling the session_start() and also why would I get this warning with php 5.5 and not with 5.2? This is how I start all of my pages:

    PHP Code:
    <?php
    ob_start
    ();
    session_start();

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,673
    Any chance you saved your script as UTF-8 with BOM (byte order mark)? If so, the BOM is normally invisible but the first character(s) in the file.

    PS: In that case, fix is to save it as UTF-8 without BOM if your editor allows, or else save as plain ASCII.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Feb 2012
    Posts
    102
    Quote Originally Posted by NogDog View Post
    Any chance you saved your script as UTF-8 with BOM (byte order mark)? If so, the BOM is normally invisible but the first character(s) in the file.

    PS: In that case, fix is to save it as UTF-8 without BOM if your editor allows, or else save as plain ASCII.
    Tried your suggestion but no luck. Still getting the same error message.

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,673
    Where does the error message say that output was started? Maybe this file is being included by another file, and that parent file is the one doing output at some point?

    Only other thing I can think of is if you have your PHP configuration doing an auto_prepend_file, which could be causing output to be generated (including the annoying newline following the closing ?> tag -- which is why I leave those tags out ).
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,589
    Quote Originally Posted by mcco View Post
    I had been using php version 5.2 and everything was working fine but when I upgraded to version 5.5 I started getting a warning saying:


    Warning: session_start(): Cannot send session cache limiter - headers already sent

    This doesnt make any sense to me as I do not have any output prior to calling the session_start() and also why would I get this warning with php 5.5 and not with 5.2? This is how I start all of my pages:

    PHP Code:
    <?php
    ob_start
    ();
    session_start();
    Any chance you have tried it the other way around?

    PHP Code:
    <?php
    session_start
    ();
    ob_start();
    See if that comes up with another error or not.
    If your post falls off the page, bump it. ...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles