Twice now I've run into this class of problem and so I'm documenting it here for my future self and anyone else with a similar problem. Most recently, a server I manage was generating a rather baffling error, seemlingly randomly Warning: file_put_contents(temporary:///.htaccess) [function.file-put-contents]: failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_create_htaccess() (line 498 of /[documentroot]/includes/file.inc). Baffling because apache (and pretty much any other process on a linux server) has access to read and write to the /tmp directory, and extra baffling because the file was there, created. It seemed to be mostly when editing, but not uniquely. After doing a stack trace, I discovered this about file management in Drupal: As a security measure, Drupal checks for an .htaccess file in all directories it writes to. That includes the temporary directory [which is good, because sometimes that directory is ins...