会话开始但给出缓存限制器错误

Hello i am Getting this error from past few days i already hunt in google search and found following solution for session but this also not working for me

Warning
: session_start(): Cannot send session cache limiter - headers already     sent (output started at /home/user/public_html/pages/about-us.php:65) in
/home/user/public_html/pages/inc/header.php


<?php
session_set_cookie_params(0, '/', '.mysite.com');
session_start();
?>

Just try with this:

<?php
ob_start();
session_start();
?>

hope will solve your issue.

Solution 1: Call session_start() before anything is printed to the output

session_start() should be the very first code on your page. The session can be started only before the server sends the very first byte to the browser, because session info is sent in the headers and the modification of headers is not allowed after the very first byte was sent. So once the very first byte leaves the server, there is no going back. So ensure there is nothing, not even a white space before:

<?php
    session_start();
    ...
?>

For example the following will not work

Hello world.

<?php
    session_start();
    /* Warning occures here because "Hello world." text
     * was already sent to the browser.*/
?>

Same problem with the following code:

<?php
    echo "Hello world."
    session_start();
    /* Warning occures here because "Hello world." text
     * was already sent to the browser.*/
?>

However, the following is ok:

<?php
    session_start();
    echo "Hello world."
?>

Also you can do anything before session start which does not cause printing to the output. For example, you can do the following without any troubles:

<?php
    $i = 5;
    session_start();
?>

Solution 2: Use output buffering

If you do not want to start the session at the beginning of the request but you want to do that at a later point, you will have to use the output buffer. Output buffer ensures that the content that would be normally sent to the browser almost immediately will be instead buffered on the server side and then sent to the browser altogether once the whole page is ready or in chunks - based on how you actually use it. The downsize is that the user will have to wait for the page a bit longer. You can start the output buffer by calling:

<?php
    ob_start();
?>

But make sure that this is code is called before anything is printed - i.e. make this the very first command. Later on, once you are done with your session_start or any other modifications of the HTTP headers or once your page is fully generated, simply call

<?php
    ob_end_flush();
?>

to finish the output buffering and print out what is in the buffer.