Re: how do I fix this " Warning: session_start() : Cannot send session cache limiter"
Gordon Burditt wrote:[color=blue][color=green][color=darkred]
> >> >>> session_start() ;
> >> >>> session_registe r();
> >> >>
> >> >>You probably have a blank space or an empty line somewhere between the
> >> >>beginning of a file and the first "<?"... Find it and delete it.[/color][/color]
>
> Unfortunately, white space and other body output isn't the only
> thing that causes headers to be sent. Sending headers (e.g.
> session_start() ) also causes headers to be sent. If you're going
> to setcookie(), setcookie() before session_start() and before any
> output.
>
> Also, don't call session_start() before session_start() . Limit:
> one call per PHP hit.
>
> session_registe r() should only be used if register_global s is on,
> which it shouldn't be, so don't use it. Use $_SESSION.
>
>[color=green]
> >But as I said earlier in the thread, PHP is giving me bum messages that
> >offer no illumination.[/color]
>
> They are telling you where the problem is. White space is a common,
> and difficult to find, but not the only cause of headers being sent.[/color]
I think you are right, they are telling me where the problem is. I now
suspect the error was being triggered when this class method (which
sends a charset header) was called:
function command() {
// 09-02-04 - we want the server to send a header explaining that the
charset is
// UTF-8 (which the software is now going to standardize around, I
just changed
// the functions standardInput() and standardOutput( ) to cast all
input to UTF-8).
// How can Apache know the right charset when all the text is stored
in a MySql
// database? It seems likely to me that we need to take responsiblity
for ensuring
// that the right header is sent. This function now gets called at
the top of
// both configAdminEven ts.php and configPublicEve nts.php
$this->core->notes("We are at the beginning of command() in
CommandSendUtf8 Header.");
if (function_exist s("headers_sent ")) {
$sent = headers_sent();
if (!$sent) header("Content-type:text/html;charset=UT F-8");
}
$this->core->notes("We are at the end of command() in
CommandSendUtf8 Header.");
ob_end_flush();
}
Gordon Burditt wrote:[color=blue][color=green][color=darkred]
> >> >>> session_start() ;
> >> >>> session_registe r();
> >> >>
> >> >>You probably have a blank space or an empty line somewhere between the
> >> >>beginning of a file and the first "<?"... Find it and delete it.[/color][/color]
>
> Unfortunately, white space and other body output isn't the only
> thing that causes headers to be sent. Sending headers (e.g.
> session_start() ) also causes headers to be sent. If you're going
> to setcookie(), setcookie() before session_start() and before any
> output.
>
> Also, don't call session_start() before session_start() . Limit:
> one call per PHP hit.
>
> session_registe r() should only be used if register_global s is on,
> which it shouldn't be, so don't use it. Use $_SESSION.
>
>[color=green]
> >But as I said earlier in the thread, PHP is giving me bum messages that
> >offer no illumination.[/color]
>
> They are telling you where the problem is. White space is a common,
> and difficult to find, but not the only cause of headers being sent.[/color]
I think you are right, they are telling me where the problem is. I now
suspect the error was being triggered when this class method (which
sends a charset header) was called:
function command() {
// 09-02-04 - we want the server to send a header explaining that the
charset is
// UTF-8 (which the software is now going to standardize around, I
just changed
// the functions standardInput() and standardOutput( ) to cast all
input to UTF-8).
// How can Apache know the right charset when all the text is stored
in a MySql
// database? It seems likely to me that we need to take responsiblity
for ensuring
// that the right header is sent. This function now gets called at
the top of
// both configAdminEven ts.php and configPublicEve nts.php
$this->core->notes("We are at the beginning of command() in
CommandSendUtf8 Header.");
if (function_exist s("headers_sent ")) {
$sent = headers_sent();
if (!$sent) header("Content-type:text/html;charset=UT F-8");
}
$this->core->notes("We are at the end of command() in
CommandSendUtf8 Header.");
ob_end_flush();
}
Comment