You are here: Re: how do I fix this " Warning: session_start(): Cannot send session cache limiter" « PHP Programming Language « IT news, forums, messages
Re: how do I fix this " Warning: session_start(): Cannot send session cache limiter"

Posted by lawrence k on 06/18/06 20:26

Gordon Burditt wrote:
> >> >>> session_start();
> >> >>> session_register();
> >> >>
> >> >>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.
>
> 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_register() should only be used if register_globals is on,
> which it shouldn't be, so don't use it. Use $_SESSION.
>
>
> >But as I said earlier in the thread, PHP is giving me bum messages that
> >offer no illumination.
>
> 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.

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 configAdminEvents.php and configPublicEvents.php

$this->core->notes("We are at the beginning of command() in
CommandSendUtf8Header.");

if (function_exists("headers_sent")) {
$sent = headers_sent();
if (!$sent) header("Content-type:text/html;charset=UTF-8");
}
$this->core->notes("We are at the end of command() in
CommandSendUtf8Header.");
ob_end_flush();
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация