# PHP filesystem best practice

I'm writing a PHP script which communicates with another program via files. I wonder if there is some policy or standard on where to put such files? I assume choosing a path like C:\foo\bar\ isn't the best? If nothing else it's not portable.

Would $_SERVER['HOME'] be a good place or is there something more appropriate? The temp folder is not good as the files technically aren't temporary. For a Windows application I think you would typically use %appdata%\\{company name}\\{app name} but that's obviously not that great for PHP. • I would imagine $_SERVER['HOME'] is not a good idea because the other app is probably not going to have access to the same variable. Jul 2, 2015 at 16:13