NYCPHP Meetup

NYPHP.org

[nycphp-talk] warning message on the php page

David Krings ramons at gmx.net
Tue Feb 5 16:25:04 EST 2008


chad qian wrote:
> Hi,
> I try to debug one php page.Everything is fine but I always get this 
> error message on top when I load the web page:
>  
> *Warning*: session_start() [_function.session-start_ 
> <http://chad.geta2q.com/function.session-start>]: Cannot send session 
> cache limiter - headers already sent (output started at 
> /home/getatwoq/public_html/chad/registrationverified.php:3) in 
> */home/getatwoq/public_html/chad/inc/prehtml.php* on line *23*
> ** 
> I want to get rid of this meaage when I locad the php web page.
>  
> How to do it?

I found that session_start() works only OK when it is the first thing that 
happens in a script. Before initializing variables and anything.
You script should start as such

<?php  // Line 1
   session_strt(); // Line 2

....everything else


I follow that strictly and since then never had a problem.


David




More information about the talk mailing list