session_start error.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • K. Choi

    #1

    session_start error.

    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

    #2
    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_global s to off.

    --
    Well-behaved women seldom make history

    Comment

    • Marian Heddesheimer

      #3
      Re: session_start error.

      On 28 Jun 2004 20:07:16 -0700, kiyoung.choi@gm ail.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 Projektbetreuun g
      http://www.heddesheimer.de/coaching/

      Comment

      • K. Choi

        #4
        Re: session_start error.

        Mladen Gogala <gogala@sbcglob al.net> wrote in message news:<pan.2004. 06.29.03.35.42. 372684@sbcgloba l.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_global s to off.[/color]

        It already off. :-(

        Comment

        • GR33DY

          #5
          Re: session_start error.

          K. Choi wrote:
          [color=blue]
          > Mladen Gogala <gogala@sbcglob al.net> wrote in message news:<pan.2004. 06.29.03.35.42. 372684@sbcgloba l.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_global s 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

          Comment

          Working...