Problems with image/file upload in MediaWiki on Windows 2008 Server R2, using wrong temp directory

Posted by Lasse V. Karlsen on Server Fault See other posts from Server Fault or by Lasse V. Karlsen
Published on 2010-03-24T13:01:53Z Indexed on 2010/03/24 13:03 UTC
Read the original article Hit count: 451

Filed under:
|
|
|

I have installed MediaWiki 1.15.2 under IIS as per the MediaWiki installation instructions for Windows 2008 Server.

I have configured PHP to use a specific temp directory:

upload_tmp_dir="C:\php\uploadtemp"

I have specified that MediaWiki is allowed to upload:

$wgEnableUploads       = true;

But when I try to upload an image, I get this error message in my browser:

Internal error
Could not find file "C:\Windows\Temp\php1AEA.tmp".

Retrying will simply give me a new filename, but in the same location. The directory does not have any php* files in it, but since they're "temporary", they might be gone in a flash before Windows Explorer is able to show them so that might be a red herring.

I've googled for this, and the most promising lead I found was on this page: Image upload problem - Is this bug fixed?, but since the text says "a bugfix was posted on the bug-report page", but provides no link to which bug page this relates to (php or mediawiki) nor the actual bug report, I've not found conclusively the bug report in question so that didn't help me much.

Lots of pages indicates that this is a permission issue, so I tried setting permissions on c:\windows\temp as Modify by Everyone, still no dice.

I tried changing the two system environment variables TEMP and TMP to point to C:\Temp instead, but MediaWiki still complains about not finding the file in C:\Windows\Temp.

Note that I don't care a lot about where the files will actually be stored temporarily, so c:\windows\temp is fine by me. I do, however, care about them actually being uploaded correctly.

Does anyone know of a fix, have any leads I can follow, or whatnot?

The server is running Windows 2008 Server R2, all patches installed, and the PHP installed is 5.3.2, using IIS FastCGI.

© Server Fault or respective owner

Related posts about mediawiki

Related posts about upload