2

Warning: session_start(): Cannot send session cache limiter - headers already sent in line 2. Even though I have made session_start as my first line. Kindly suggest any solutions.

    <?php 
    ob_start();
    session_start();  
    error_reporting(0);
    ?>
  • 1
    Make sure that there is no whitespace or invisible characters before the ` – Paul Nov 24 '18 at 04:38
  • 1
    Start at the beginning of the page and remove any white space, don't use multiple sessions – Akhtar Munir Nov 24 '18 at 04:42
  • 2
    @AkhtarMunir About your comment: *"don't use multiple sessions"* - If they were using multiple sessions, the error would have been different. This question/error is about sending output before header, not having started the session more than once. – Funk Forty Niner Nov 24 '18 at 04:47
  • 1
    or you can also use @session_start(); this also will remove your warning – Parvej Alam Nov 24 '18 at 05:01
  • 1
    @Parvej Alam But there is no blank space in my code... – Madhubala Jayakumaran Nov 24 '18 at 05:15
  • 1
    Finally I fixed it. Thank you for all your suggestions!! I have changed the file encoding to UTF-8 without BOM :) – Madhubala Jayakumaran Nov 24 '18 at 05:46
  • maybe, you just **included your script** from within another script, and that script already created some output before it finally included it. [see this answer](https://stackoverflow.com/a/19850018/1069083) – rubo77 Mar 26 '21 at 05:33

0 Answers0