Problem with sessions

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

    Problem with sessions

    Hi all!

    I'm new to PHP...

    I wrote a php script for login page, which creates some session
    variables after validating the user... But it's not working...

    When i compile it... The compiler is giving me the following
    Warnings...

    ----------------------------------------------------------------------------------
    PHP Warning: session_start() :
    open(/var/lib/php/session/sess_f207f20079 897ad6f830fc632 fa5e0c0,
    O_RDWR) failed: Permission denied (13)

    PHP Warning: session_start() : Cannot send session cookie - headers
    already sent by (output started at /home/gana/public_html/login.php:4)

    PHP Warning: session_start() : Cannot send session cache limiter -
    headers already sent

    PHP Warning: Unknown():
    open(/var/lib/php/session/sess_f207f20079 897ad6f830fc632 fa5e0c0,
    O_RDWR) failed: Permission denied (13)

    PHP Warning: Unknown(): Failed to write session data (files). Please
    verify that the current setting of session.save_pa th is correct
    (/var/lib/php/session)
    ----------------------------------------------------------------------------------

    Please help me... Thanks in advance...

    - Ganesh
  • Brent Palmer

    #2
    Re: Problem with sessions

    Hello.
    Make sure that you start the session before any HTML or headers as the error
    states.
    Eg.

    <?php
    session_start;
    ?>
    <html><head> and so on......

    Also if you are including other pages make sure there is only one session
    start all together..

    Brent Palmer.


    "Ganesh" <ganesh.m@gmail .com> wrote in message
    news:e3ac1256.0 503102058.d7877 2b@posting.goog le.com...[color=blue]
    > Hi all!
    >
    > I'm new to PHP...
    >
    > I wrote a php script for login page, which creates some session
    > variables after validating the user... But it's not working...
    >
    > When i compile it... The compiler is giving me the following
    > Warnings...
    >
    > ----------------------------------------------------------------------------------
    > PHP Warning: session_start() :
    > open(/var/lib/php/session/sess_f207f20079 897ad6f830fc632 fa5e0c0,
    > O_RDWR) failed: Permission denied (13)
    >
    > PHP Warning: session_start() : Cannot send session cookie - headers
    > already sent by (output started at /home/gana/public_html/login.php:4)
    >
    > PHP Warning: session_start() : Cannot send session cache limiter -
    > headers already sent
    >
    > PHP Warning: Unknown():
    > open(/var/lib/php/session/sess_f207f20079 897ad6f830fc632 fa5e0c0,
    > O_RDWR) failed: Permission denied (13)
    >
    > PHP Warning: Unknown(): Failed to write session data (files). Please
    > verify that the current setting of session.save_pa th is correct
    > (/var/lib/php/session)
    > ----------------------------------------------------------------------------------
    >
    > Please help me... Thanks in advance...
    >
    > - Ganesh[/color]


    Comment

    • ganesh.m@gmail.com

      #3
      Re: Problem with sessions

      Hey!... Now it's working all of a sudden...
      may be there is some fault with the time settings some where...

      any help please...

      Comment

      • Malcolm Dew-Jones

        #4
        Re: Problem with sessions

        Ganesh (ganesh.m@gmail .com) wrote:
        : Hi all!

        : I'm new to PHP...

        : I wrote a php script for login page, which creates some session
        : variables after validating the user... But it's not working...

        : When i compile it... The compiler is giving me the following
        : Warnings...

        : ----------------------------------------------------------------------------------
        : PHP Warning: session_start() :
        : open(/var/lib/php/session/sess_f207f20079 897ad6f830fc632 fa5e0c0,
        : O_RDWR) failed: Permission denied (13)


        "Permission denied"

        /var/lib/php/session/...

        That looks like a very likely explanation for why your script doesn't
        work.




        --

        This space not for rent.

        Comment

        • Mladen Gogala

          #5
          Re: Problem with sessions

          On Thu, 10 Mar 2005 20:58:11 -0800, Ganesh wrote:
          [color=blue]
          > PHP Warning: Unknown(): Failed to write session data (files). Please
          > verify that the current setting of session.save_pa th is correct
          > (/var/lib/php/session)
          > ----------------------------------------------------------------------------------
          >
          > Please help me... Thanks in advance...
          >
          > - Ganesh[/color]


          Set session.save_pa th to something writable like /usr/tmp or /tmp and
          restart Apache. If PHP is installed as a module, then the directory you
          select must be writable by user "nobody". Alternatively, you could do
          "chmod 4777 /var/lib/php/session" and merrily continue PHP-ing.

          --
          A clean tie attracts the soup du jour.

          Comment

          Working...