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.

Very large PHP session files in /tmp

Discussion in 'General Discussion' started by teddymills, Aug 19, 2005.

  1. teddymills

    teddymills Member

    Joined:
    Jul 25, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    On my cpanel server in /tmp there are some very large PHP session files.
    In fact almost 1GB in /tmp with these PHP files taking up most of the space.

    When can I safely delete these files?


    root@ca01 [/tmp]# ll |sort +4 -nr
    -rw------- 1 nobody nobody 265089024 Aug 19 09:26 phpBKzOaY
    -rw------- 1 nobody nobody 40783073 Aug 16 06:28 phpJVwrqv
    -rw------- 1 nobody nobody 40772835 Aug 16 06:28 php1MhLAt
    -rw------- 1 nobody nobody 40578313 Aug 16 06:28 php6eoB8W
    -rw------- 1 nobody nobody 40506647 Aug 16 06:28 phpkvakFP
    -rw------- 1 nobody nobody 40491290 Aug 16 06:28 phpNUqTA8
    -rw------- 1 nobody nobody 40168793 Aug 16 06:28 phpUM1ltU
    -rw------- 1 nobody nobody 40168793 Aug 16 06:28 phpfsZEim
    -rw------- 1 nobody nobody 40122722 Aug 16 06:28 phpW4d8wy
    -rw------- 1 nobody nobody 40112484 Aug 16 06:28 phpDIqX7S
    ...
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Since they're created by the php scripts that you have installed on the server, then you'd have to check with your clients (if you have any) as deleting those could cause data corruption or loss. You could also ask them to rewrite their code or get application amendments since they should not being using such large amounts of disk space for what are meant to be temporary files, and should at the very least tidy up after themselves. That said, it's might usually be safe to remove them after they're 24 hours old, but it really does depend on the apps you have running.

    An alternative, if you have phpsuexec enabled, is to identify the culrpit php script and create a local php.ini file with a temporary file location directive in it pointing to within their own web space.

    ATEOTD, it's poor programming.
     
  3. fred123123

    fred123123 Well-Known Member

    Joined:
    Jul 23, 2005
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    but could this be temporary space for file upload script ?
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Not the cPanel one, no, they use a different naming convention (and doesn't use php). It could certainly be for some php script installed on someones site that allows file uploads.
     
Loading...

Share This Page