NYCPHP Meetup

NYPHP.org

[nycphp-talk] warning message on the php page

Daniel Convissor danielc at analysisandsolutions.com
Wed Feb 6 10:35:48 EST 2008


Folks:

On Tue, Feb 05, 2008 at 08:11:24PM -0500, Dan Cech wrote:
> chad qian wrote:
> >
> >Warning: session_start() [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

Personally, I've been ignoring this thread.  The error message PHP 
produces is completely clear about what and where the problem is.  But 
Dan, who's pretty good about stuff, posted, and I was curious about what 
drew him into the fray.  I've got to disagree with a few things he said.


> The output is being started on line 23 of prehtml.php.

Actually, the error message says "output started at... 
registrationverified.php:3."  The ":3" means line 3.  That aside,


> Odds are fairly 
> good that this file is 23 lines long and the end of the file looks like 
> this:
> 
> ?>[\n]
> 
> That trailing newline after the closing PHP tag is causing output to 
> start and resulting in the error message above.

Nope.  PHP is okay with one line break after the ?>, but not two.



> 2. End the file with a comment, like:
> 
> // end of file[\n]

I agree it's much cleaner to not include the closing ?> at the end of the 
file.  But putting a comment about it being the end of the file is 
completely supurfluous.  The end of the file is the end of the file.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list