Connecting Tech Pros Worldwide Help | Site Map

session_start error.

K. Choi
Guest
 
Posts: n/a
#1: Jul 17 '05
I had installed php 4.3.7 on my system and test some php code.
But there is a serious problem. On my system(using apache2) the code,

<?php
session_start();
?>

gets some warning,

Warning: session_start(): read returned less bytes than requested in
/home/http/index.html on line 2

Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at /home/http/index.html:2) in
/home/http/index.html on line 2

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at /home/http/index.html:2) in
/home/http/index.html on line 2

Whant is the solution of this problem? Please me. :=(
Mladen Gogala
Guest
 
Posts: n/a
#2: Jul 17 '05

re: session_start error.


On Mon, 28 Jun 2004 20:07:16 -0700, K. Choi wrote:
[color=blue]
>
> Warning: session_start(): read returned less bytes than requested in
> /home/http/index.html on line 2
>
> Warning: session_start(): Cannot send session cookie - headers already
> sent by (output started at /home/http/index.html:2) in
> /home/http/index.html on line 2
>
> Warning: session_start(): Cannot send session cache limiter - headers
> already sent (output started at /home/http/index.html:2) in
> /home/http/index.html on line 2
>
> Whant is the solution of this problem? Please me. :=([/color]


Try setting register_globals to off.

--
Well-behaved women seldom make history

Marian Heddesheimer
Guest
 
Posts: n/a
#3: Jul 17 '05

re: session_start error.


On 28 Jun 2004 20:07:16 -0700, kiyoung.choi@gmail.com (K. Choi) wrote:
[color=blue]
>Warning: session_start(): Cannot send session cookie - headers already
>sent by (output started at /home/http/index.html:2) in
>/home/http/index.html on line 2[/color]

it means that your script has produced an output in line2 at
index.html that should not be there.

session_start() must be the first command in your script, before any
output (not even a blank or new line) is sent to the browser.

Regards

Marian

--
Tipps und Tricks zu PHP, Coaching und Projektbetreuung
http://www.heddesheimer.de/coaching/
K. Choi
Guest
 
Posts: n/a
#4: Jul 17 '05

re: session_start error.


Mladen Gogala <gogala@sbcglobal.net> wrote in message news:<pan.2004.06.29.03.35.42.372684@sbcglobal.net >...[color=blue]
> On Mon, 28 Jun 2004 20:07:16 -0700, K. Choi wrote:
>[color=green]
> >
> > Warning: session_start(): read returned less bytes than requested in
> > /home/http/index.html on line 2
> >
> > Warning: session_start(): Cannot send session cookie - headers already
> > sent by (output started at /home/http/index.html:2) in
> > /home/http/index.html on line 2
> >
> > Warning: session_start(): Cannot send session cache limiter - headers
> > already sent (output started at /home/http/index.html:2) in
> > /home/http/index.html on line 2
> >
> > Whant is the solution of this problem? Please me. :=([/color]
>
>
> Try setting register_globals to off.[/color]

It already off. :-(
GR33DY
Guest
 
Posts: n/a
#5: Jul 17 '05

re: session_start error.


K. Choi wrote:
[color=blue]
> Mladen Gogala <gogala@sbcglobal.net> wrote in message news:<pan.2004.06.29.03.35.42.372684@sbcglobal.net >...
>[color=green]
>>On Mon, 28 Jun 2004 20:07:16 -0700, K. Choi wrote:
>>
>>[color=darkred]
>>>Warning: session_start(): read returned less bytes than requested in
>>>/home/http/index.html on line 2
>>>
>>>Warning: session_start(): Cannot send session cookie - headers already
>>>sent by (output started at /home/http/index.html:2) in
>>>/home/http/index.html on line 2
>>>
>>>Warning: session_start(): Cannot send session cache limiter - headers
>>>already sent (output started at /home/http/index.html:2) in
>>>/home/http/index.html on line 2
>>>
>>>Whant is the solution of this problem? Please me. :=([/color]
>>
>>
>>Try setting register_globals to off.[/color]
>
>
> It already off. :-([/color]

Make sure that there are no blank lines before session_start(), also
check that the file is saved in ANSI encoding and uploaded in ascii.

G
Closed Thread