The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

error reading session data

Discussion in 'General Discussion' started by ccarpenter, Jun 15, 2009.

  1. ccarpenter

    ccarpenter Registered

    Joined:
    May 24, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Dear all,

    I've been using hbridge to get users into their Horde email for some years, it has worked fine until now.... My VM has been upgraded to a better machine and although I've made every effort to ensure that all installed software (Apache, PHP and all the various modules) are identical then new VM gives the following error "error reading session data" when the user runs the PHP hbridge login script. It feels like I've just missed a setting somewhere on the new server but I just can't find it - could anyone give me some pointers to help troubleshoot this?

    Many thanks in advance,
     
  2. Eri

    Eri Registered

    Joined:
    Jun 15, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Did it JUST stop working?

    Did the problem you are having just materialize within the last 24 hours or so?

    I just started having a huge problem with session variables--I've been banging my head against my desk for six hours wondering why a very simple PHP script I am writing isn't working and have just been trying to explain it (at 4:00am) to my sleeping system administrator who is a crack network guy but NOT a coder at all.

    He thought I was writing the code wrong and suggested I go back to a working script and make sure that section of code matched exactly. So I went back to two scripts I've been working on for the past month--both of which worked perfectly on Friday--and neither of them works at all because they both depend entirely on $_SESSION for user access.

    Maybe this has something to do with your problem? Or maybe it is completely unrelated. I would be interested in hearing about your resolution, if you find one. If I figure out the problem I will post.

    --Eri
     
  3. ccarpenter

    ccarpenter Registered

    Joined:
    May 24, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi Eri,

    No, the problem is only occuring on my new server, the old one which is working and suposedly (although clearly not) identically configured still runs those scripts faultlessly - I hate these sort of problems, you go round and round for ages and it always turns out to be something really obvious!!!!!!
     
  4. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Fortunately I AM a "crack system administrator" and "coder" and been
    doing what I do for well over 30 years now.

    Now regarding your not being able to initialize sessions, there are a number
    of different things that could cause that particular problem and I would
    have to have more information or see what is going on myself to be able
    to tell you with any degree of certainty which is your problem.

    Basically though your problem will be in PHP, Apache, or installed libraries
    (although the latter is usually less likely for this). For the former two,
    you would need to review configuration (php.ini / httpd.conf) and the
    original compile options to get a better idea what is going on.

    I would be most interested in your PHP.INI, the current settings of
    "session.save_handle", "session.save_path", and "session.autostart"
    and that is where I would probably begin looking.

    The following link may also be of some use to you:
    http://us2.php.net/manual/en/session.configuration.php#ini.session.auto-start
     
    #4 Spiral, Jun 15, 2009
    Last edited: Jun 15, 2009
  5. ccarpenter

    ccarpenter Registered

    Joined:
    May 24, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi Spiral,

    Thanks for taking the time to look at this thread.

    I've looked at the php.ini files on the working and non-working servers and sure enough one of the parameters you mention was different. The working server had:-

    session.save_path = /tmp

    and the non-working had:-

    session.save_path = "/var/lib/php/session"

    I changed the files to match and restarted Apache, confidence was fairly high but immediately dashed - same error!

    Just to remove php.ini from the investigation I copied it from the old server to the new one (after backup up the original first!) and restarted - still no better.

    I'm convinced the problem will end up being something really simple to fix - it's just knowing where to look - do you know of any php scripts that I could run that might yield a bit more troubleshooting information?

    Many thanks again for your time.
     
  6. ccarpenter

    ccarpenter Registered

    Joined:
    May 24, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Sorted! The problem was in php.ini - the reason I wasn't getting anywhere is that I was editing the WRONG php.ini file!!! Checking where php was actually looking for its ini file I found it in /usr/local/lib and bingo, editing that file I found that the session.save_path line was actually commented out. Sorted that, restarted Apache and all is working now.

    Many thanks again to all who helped.
     
  7. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Glad to be of help! :D

    Yes, /usr/local/lib is now the default location for the PHP.INI file
    but you can always double check that with a quick phpinfo() check.
     
Loading...

Share This Page