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();
    Owner of Reality TV Addict
    Publisher of Strategies for Stretching Your Income (ebook)
    CEO and Founder of Sport Directions
    Follow me at @RealityTV_Forum

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,251
    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.
    Owner of Reality TV Addict
    Publisher of Strategies for Stretching Your Income (ebook)
    CEO and Founder of Sport Directions
    Follow me at @RealityTV_Forum

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,251
    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,343
    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.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

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