|
Posted by Andy Hassall on 11/06/06 04:24
On Sun, 05 Nov 2006 23:17:19 -0500, IchBin <weconsul@ptd.net> wrote:
>I am getting the error message below when ever I try to start my script
>on two different servers. I am not getting any errors off of my PC. I
>have looked around and found the answer a simple one. I can not stop the
>error in my script. The session_start() is the first thing that happens
>before any Headers are created. Any one have any suggestions. Include
>the start of the code that uses the session var.
>
>Warning: session_start(): Cannot send session cookie - headers already
>sent by (output started at
>/home/www/ichbinquotations.awardspace.com/quotes/quotes.php:1) in
>/home/www/ichbinquotations.awardspace.com/quotes/quotes.php on line 8
>
>Warning: session_start(): Cannot send session cache limiter - headers
>already sent (output started at
>/home/www/ichbinquotations.awardspace.com/quotes/quotes.php:1) in
>/home/www/ichbinquotations.awardspace.com/quotes/quotes.php on line 8
>
> <?php
Do you really have this indentation in the script before the <?php tag? If so,
that's where the output is coming from - and that's also backed up by the error
saying the output started on line 1.
It's possible to mask these problems by turning on one of the variants of
output_buffering, but it's best practice to eliminate the output before any
headers are sent so it works with or without buffering. This may explain why
you see it on one setup but not the other - you probably have buffering (or
zlib output compression) turned on.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|