By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

session_start error.

P: n/a
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. :=(
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Mon, 28 Jun 2004 20:07:16 -0700, K. Choi wrote:

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. :=(

Try setting register_globals to off.

--
Well-behaved women seldom make history

Jul 17 '05 #2

P: n/a
On 28 Jun 2004 20:07:16 -0700, ki**********@gmail.com (K. Choi) wrote:
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


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/
Jul 17 '05 #3

P: n/a
Mladen Gogala <go****@sbcglobal.net> wrote in message news:<pa****************************@sbcglobal.net >...
On Mon, 28 Jun 2004 20:07:16 -0700, K. Choi wrote:

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. :=(

Try setting register_globals to off.


It already off. :-(
Jul 17 '05 #4

P: n/a
K. Choi wrote:
Mladen Gogala <go****@sbcglobal.net> wrote in message news:<pa****************************@sbcglobal.net >...
On Mon, 28 Jun 2004 20:07:16 -0700, K. Choi wrote:

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. :=(

Try setting register_globals to off.

It already off. :-(


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
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.