Stale temp directories after running phpmd/phpcs/phpcsfixer
Hi.
I use these three tools (PHP Mess Detector, Code Sniffer, CS Fixer). The integration into PhpStorm works flawlessly.
What annoys me is that PhpStorm does not clean up the auxiliary dirs in my /tmp directory after calling the tools.
After few minutes of work there are hundreds of them. This makes /tmp unusable for normal usage. Just a fraction:

1) is it possible to make PhpStorm clean up these directories when they are not needed any more?
2) if not, is there a way to change their location so they don't flood the top-level tmp directory?
Thanks for any ideas.
Please sign in to leave a comment.
Unfortunately, the answer is 'no' to both questions, you can make PhpStorm to neither clean up after itself nor change the directory.
You can create a usability issue on our tracker, but I asked the dev what she thinks about it, and she doubts it's going to be our top priority.
I wonder what you mean by the 'normal usage' of the /tmp directory though.
Thanks for your input.
By 'normal usage' I mean, for example, being able to look up a file in a file manager without having to scroll down over hundreds of lines of garbage.
Anyway, I found a solution after all. I added this to my VM options
and PhpStorm seems to respect that, it creates its working files in that subdirectory now.
Cheers
Thank you for sharing the workaround, I was close to thinking about it but only checked the registry for tmp/temp and didn't care to google, shame on me.
Having the same issue:
THOUSANDS of silly leftover empty folder hierarchies in the form of:
phpmd_temp.tmp****
in my %APPDATA%\Local\Temp folder.
(PHPStorm 2020.1.1)
It does seem a bit ridiculous when one user saying there are 2500 of these temporary directories which don't automatically get removed.
https://youtrack.jetbrains.com/issue/WI-50525
Great tip about the java.io.tmpdir, I ended up creating a systemd-tmpfiles-clean config to try and manage the proliferation.
Mostly I could ignore this, but occasionally it causes problems, I was running the Xdebug profiler which I have the cachegrind files going to /tmp and then opening one of those files in PHPStorm is a chore with the small dialog box.