[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


PHP tmp files

Posted on 2012-08-23
Medium Priority
Last Modified: 2012-11-13
My drives filling up with .tmp files which aren't being cleared down.

Originally, they were being stored in


I changed the following line in php.ini;


and now thew files are being saved in the new location.

Can anybody advise what these files are and what the best course of action is to ensure they get cleared down?
Is it safe to delete any of these manually?

php running under apache
it's for a moodle webserver.

Question by:stantechserv
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38324295
Can you check this function , "session.gc_maxlifetime"  value set in your php.ini, ?

Author Comment

ID: 38324418
session.gc_maxlifetime = 1440


Expert Comment

by:Derek Jensen
ID: 38324927
Any files that end in .tmp are usually safe to delete.

Also, you could just open one of them and see what they contain. If vi or emacs can't interpret them(you just see jibberish), I'd say they're definitely safe to delete.

Having said that, I'd definitely recommend making a backup of them first, *just in case*. If you're low on space, consider gzipping them, or something. :)

As for a more permanent solution to your problem, are you sure it's one of your PHP files generating these .tmp files? If so, it should be fairly straightforward to find the code that's doing it and either change or delete it. There's no reason session variables should be stored, permanently, on the server hard drive(unless you're trying to catch a hacker, or something).
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38327956
just want to know all those files are .tmp extensions ?? because it should have session files like "sess_3c98e617d6f2a2a287a7ef409799a6fb" ... it will be deleted automatically based on the time minutes set in "session.gc_maxlifetime"

Author Comment

ID: 38328238
Filenames have names like;


The session files as suggested do seem to be deleted automatically.

I don't think I've mentioned it but this is all running on a Windows 2008 R2 host server

Expert Comment

ID: 38575538

Its may be created by your Editor/IDE whichever you have been using.

The editor may create this files, for the quick processing.

Just configure your editor not to create tmp files.

This will solve your problem.


Accepted Solution

stantechserv earned 0 total points
ID: 38579232
I fogot to update this. I found the issue to be with permissions, I gave the user; .\IUSR modify permissions to the folder which resolved this



Author Closing Comment

ID: 38593808
Resolved the issue I was having. None of the other solutions were viable as the code itself was not mine and not something I could ammend

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month19 days, 11 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question