The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'General Discussion' started by robbob, Aug 13, 2014.

  1. robbob

    robbob Member

    Joined:
    Jun 30, 2014
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi All,

    I have seen this question appear quite a few times on StackOverflow and other similar forum sites. I am getting the following error appearing at the top of my page: Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/webuyany/public_html/websitecms/editenquiry.php:1) in /home/webuyany/public_html/websitecms/editenquiry.php on line 2

    It does not appear to actually affect the functionality or look of the page but obviously I do not want errors appearing.

    A bit of background to the problem and what I have done so far...
    We recently transferred to a new server so that the site could be on its own and run a little bit quicker etc. It is only since this transfer that the error has occurred. Based on what other sites have recommended I have ensures that there is no white space before the
    PHP:
    <?php
    and also that
    PHP:
    session_start();
    is the first thing that appears. I have also made sure that it is not saving with BOM signature. Evidently the problem is still occurring (have attached a screen shot).

    I am wondering if there is something within the Apache section (software) of the WHM that needs to be ticked to enable this function to occur correctly and not display the error message?

    Thank you in advance for any help!
     

    Attached Files:

  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    This is generally an issue with the script you are using. Are the versions of Apache and PHP on the new server the same as the previous server? Have you checked to see if the same PHP modules are enabled?

    Thank you.
     
  3. robbob

    robbob Member

    Joined:
    Jun 30, 2014
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    I have had a little look and there do appear to be differences between the old and new.

    The old is using PHP 5.3.28 which us Deprecated whilst the new one is using PHP 5.4.31

    With regards to the PHP modules there appears to be a lot ticked in the old one and not the new one (assuming this is from the exhaustive list). Would it be advisable to tick any that are not ticked and then rebuild?

    I have had to add a few modules here and there since migrating the site over (mysqli for example) so would hope that the above would fix it?

    Thanks again
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, you can enable the additional options under the "Exhaustive Options List" for PHP in EasyApache and then rebuild Apache/PHP.

    Thank you.
     
  5. robbob

    robbob Member

    Joined:
    Jun 30, 2014
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I ticked everything that had not been on the old server and rebuilt and am still seeing the same problem. I had hoped that maybe it would take a little while to kick in but this has now been over 12 hours!

    Thanks
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It's possible the difference in PHP versions is the cause of the problem. I suggest consulting with the support or developers of the script you are using to see if there are any known solutions to the error message you are receiving.

    Thank you.
     
  7. piyush_lahoti

    piyush_lahoti Registered

    Joined:
    Oct 10, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I also face this warning in my app.
    when i use localhost this warning not occur.
    Why this happen I don't know
    Any one can give any idea to fix this problem?
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you elaborate on the exact issue you are experiencing? Where do you use "localhost"?

    Thank you.
     
  9. Piyush Solanki

    Piyush Solanki Registered

    Joined:
    Aug 13, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Website Owner
    You can try this
    ob_start and ob_end_flush will work for you.

    <?php
    ob_start();
    session_start();

    And at the end of the file where you complete your php tag write
    ob_end_flush();
    ?>
     
Loading...

Share This Page