Double warnings with session_start

php.internals

Unnamed Person

23 years ago
Hi, I'm devoloping a book for PHP so I'm writing a chapter about session. And I have found this new error with /usr/local/php5-17062003/bin/php -v PHP 5.0.0-dev (cli) (built: Jun 17 2003 21:40:52) Copyright (c) 1997-2003 The PHP Group Zend Engine v2.0.0-dev, Copyright (c) 1998-2003 Zend Technologies The little file.php is 1 2 <?php 3 session_start(); 4 ?> 5 session inizializzata and this is the output: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/httpd/html/LIBRO/sessioni/1.php:2) in /home/httpd/html/LIBRO/sessioni/1.php on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/httpd/html/LIBRO/sessioni/1.php:2) in /home/httpd/html/LIBRO/sessioni/1.php on line 3 session inizializzata Note the double warning. The other error for session is the not working of session_decode into a class for managing session (http://www.ziobudda.net/test/session4-3.phps). With PHP4 there is no problem with this. Bye.
-- michel 'ziobudda' morelli <michel@ziobudda.net>

Zeev Suraski

23 years ago
Any chance you have both display_errors and log_errors enabled? It would cause one copy of the error to go to stdout, and another to go to stderr. Zeev At 16:54 22/06/2003, michel 'ziobudda' morelli wrote:

Derick Rethans

23 years ago
On Sun, 22 Jun 2003, Zeev Suraski wrote:
> Any chance you have both display_errors and log_errors enabled? It would > cause one copy of the error to go to stdout, and another to go to stderr.
uhm, they are different messages: 1. Cannot send session cookie - headers already sent by 2. Cannot send session cache limiter - headers already sent This is not really wrong then, but I agree it looks a bit weird. Derick
-- "Interpreting what the GPL actually means is a job best left to those that read the future by examining animal entrails." ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ International PHP Magazine http://php-mag.net/ -------------------------------------------------------------------------

Marco Tabini

23 years ago
Are these not two different error messages? They are output in two different places in the source. Marco On Sun, 2003-06-22 at 10:41, Zeev Suraski wrote:
> Any chance you have both display_errors and log_errors enabled? It would > cause one copy of the error to go to stdout, and another to go to stderr. > > Zeev > > At 16:54 22/06/2003, michel 'ziobudda' morelli wrote: > >Hi, I'm devoloping a book for PHP so I'm writing a chapter about > >session. And I have found this new error with > >/usr/local/php5-17062003/bin/php -v > >PHP 5.0.0-dev (cli) (built: Jun 17 2003 21:40:52) > >Copyright (c) 1997-2003 The PHP Group > >Zend Engine v2.0.0-dev, Copyright (c) 1998-2003 Zend Technologies > > > >The little file.php is > > > > 1 > > 2 <?php > > 3 session_start(); > > 4 ?> > > 5 session inizializzata > > > >and this is the output: > > > > > >Warning: session_start(): Cannot send session cookie - headers already > >sent by (output started at /home/httpd/html/LIBRO/sessioni/1.php:2) in > >/home/httpd/html/LIBRO/sessioni/1.php on line 3 > > > >Warning: session_start(): Cannot send session cache limiter - headers > >already sent (output started at /home/httpd/html/LIBRO/sessioni/1.php:2) > >in /home/httpd/html/LIBRO/sessioni/1.php on line 3 > >session inizializzata > > > >Note the double warning. > > > >The other error for session is the not working of session_decode into a > >class for managing session > >(http://www.ziobudda.net/test/session4-3.phps). With PHP4 there is no > >problem with this. > > > >Bye. > >-- > >michel 'ziobudda' morelli <michel@ziobudda.net> > > > > > >-- > >PHP Internals - PHP Runtime Development Mailing List > >To unsubscribe, visit: http://www.php.net/unsub.php
-- Marco Tabini President Marco Tabini & Associates, Inc. 28 Bombay Avenue Toronto, ON M3H 1B7 Canada Phone: (416) 630-6202 Fax: (416) 630-5057 Web: http://www.tabini.ca

Unnamed Person

23 years ago
Il dom, 2003-06-22 alle 16:37, Marco Tabini ha scritto:
> Are these not two different error messages? They are output in two > different places in the source.
with php4 (same configuration of php.ini) I have only one warning. Where is the wrong ? bye
-- michel 'ziobudda' morelli <michel@ziobudda.net>

Unnamed Person

23 years ago
> Any chance you have both display_errors and log_errors enabled?
hmmm.. In this moment I can not to control it.
> It > would cause one copy of the error to go to stdout, and another to go > to stderr.
I have the same result into web browser. Is the same possible error ? Any news about other error (session into class)? bye and tnx

Justin Hannus

23 years ago
1 2 <?php 3 session_start(); 4 ?> 5 session inizializzata It appears that line 1. has the "output" that forces the headers sent, in this case, just a newline. Anything outside the <?php ?> tags are treated as STDOUT forcing the php module to send the headers before you start your session. Try moving your <?php up to the first lline. e.g. 1 <?php 2 session_start(); 3 ?> 4 session inizializzata "Michel 'Ziobudda' Morelli" <michel@ziobudda.net> wrote in message news:1056290055.1849.7.camel@localhost.localdomain...

Unnamed Person

23 years ago
On Wed, 25 Jun 2003, Justin Hannus wrote:
> 1 > 2 <?php > 3 session_start(); > 4 ?> > 5 session inizializzata > > It appears that line 1. has the "output" that forces the headers sent, in > this case, just a newline. Anything outside the <?php ?> tags are treated as > STDOUT forcing the php module to send the headers before you start your > session. Try moving your <?php up to the first lline. e.g.
I need that line. I need to write the error for an example!. bye
-- Morelli Michel ZioBudda.net Coordinator michel@ziobudda.net

Justin Hannus

23 years ago
Oops! <michel@ziobudda.net> wrote in message news:Pine.LNX.4.44.0306251556400.17140-100000@main.ziobudda.net...
> On Wed, 25 Jun 2003, Justin Hannus wrote: > > > 1 > > 2 <?php > > 3 session_start(); > > 4 ?> > > 5 session inizializzata > > > > It appears that line 1. has the "output" that forces the headers sent,
in
> > this case, just a newline. Anything outside the <?php ?> tags are
treated as