Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2002
    Posts
    592

    [PHP] Failed to write session data (files).

    I have customer using a PHP news script developed by me but hosted elsewhere.
    The last days they are starting to have problems loging in.
    The script give the following errors:
    ======================
    Warning: session_write_close(): write failed: No space left on device (28)
    Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp)
    ======================

    They talk to their host and he makes it work for some time until again it fails, their host says there is something wrong with the script.
    I'm not an PHP expert nor a SysAdmin so not sure where's the problem.
    I have been developing with DreamWeaver PHP for years and this is the first time it happens, I just use the Login Script behavior included from DreamWeaver, I don't code anything by hand on that area.
    So far I have investigated and it seems the /tmp partition is full, I supose a lot of tmp files(sessions aparently) are filling the partition, I have no idea about sessions files and not sure if is related with the script or the server

    Any idea?
    Do I need to change something in my script?
    Are session files being left on the /tmp partition?.. why?


    Any idea would be apreciated


    Thank you

    Giorgio

  2. #2
    Join Date
    Mar 2006
    Location
    Kentucky
    Posts
    8
    Unless you did something.. 'special' with sessions's in your script, I highly doubt it's the reason why /tmp is getting full. I'd say it's the server itself.

  3. #3
    Join Date
    Oct 2004
    Location
    Shimonoseki
    Posts
    2,101
    They talk to their host and he makes it work for some time until again it fails
    Sounds like sessions in /tmp is not being deleted regularly. Ask the host to install tmpwatch utility.
    Closed for winter...

  4. #4
    Join Date
    Dec 2002
    Posts
    592
    Quote Originally Posted by BurakUeda View Post
    Sounds like sessions in /tmp is not being deleted regularly. Ask the host to install tmpwatch utility.
    I see, but, are the sessions not being deleted because of my script or the server?
    My script has de LogOut function, but I supose they are like 2-5 current users working all day, so hardly do they need to log out.
    Hmm..., actually I think they all use the same user/pass, but different PC.

    I was asking this to make sure that is not an issue from my side.
    Thank you

    Salutes

    Giorgio
    Last edited by jagarco; 03-25-2008 at 03:07 AM.

  5. #5
    Join Date
    Aug 2002
    Location
    Canada
    Posts
    665
    Hi Giorgio,

    To answer your question, session file deletion is a result of the garbage collection directives defined in your PHP configuration file.

    http://php.net/Session

    session.gc_probability "1" PHP_INI_ALL
    session.gc_divisor "100" PHP_INI_ALL
    session.gc_maxlifetime "1440" PHP_INI_ALL
    Ensure that your GC is not set to 0/0 for example, and that the lifetime has an adequate value.

    This may be unrelated to PHP though. If your admin has mounted /tmp on a partition that is full, then you won't have any space to write to /tmp at all, resulting in the error that you see.

    Checklist:
    1. Proper space on /tmp partition
    2. Proper php.ini directives

    GL!
    Alex
    circlical - hosting software development
    forums * blog

  6. #6
    Join Date
    Dec 2002
    Posts
    592
    Thanks very much Alex

    I'll check it out

    Giorgio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •