Thread:Project:Support desk/Error creating thumbnail: Unable to save thumbnail to destination/reply (2)

I dove into the code and figured it out. The exact problem may be different from server to server, but in my case the problem was occurring at this line in /includes/filerepo/backend/TempFSFile.php: $newFileHandle = fopen( $path, 'x' );

The value of $path is partly based on the global wfTempDir function, defined in /includes/GlobalFunctions.php. This function does several checks to find a good temp folder for creating images; on my system, it failed to find anything in the environment and was falling back to sys_get_temp_dir, which told it to use "/tmp".

This should have been valid, because that folder is world-writable and there are in fact temp files there... but when I told fopen to use a different path, it started working.

What I did was to explicly set, in LocalSettings.php, one of the environment variables to point to a temp directory I had created in my account space:

putenv('TMPDIR=/path/to/my/temp/folder');

After that, everything was happy again.