Media Wiki - Upload Help Required



One of our webmasters has tried and failed to setup MediaWiki to allow image uploads, however he failed with the error “The upload directory ( is not writable by the webserver.”

I checked and he set the directory to 777 (which I thought was a little too unsecure)

However I have no experience of MediaWiki, could anyone give me some advice on what the cause may be and how to correct it?



Has he tried setting it to 755 (DH uses suexec)?



Yeah, same problem… I’ve looked at the code and the overly complicated MediaWiki website and I can’t figure out why it is the script can’t, or doesn’t think it has permissions to upload to the set directory.


THe only other thing that I can suggest is that you double-check the LocalSettings.php file for accurate path information in the $wgUploadDirectory setting.

While the error message implies a permissions problem, it also could be that mediawiki cannot write to the directory if the path is improperly specified (it can’t find that directory to write to it).

If you want to post that section of your LocalSettings.php file here, I’d be happy to look at it later tonight. :wink:



Hi, sorry it took a while to get back to you on this, I got side-tracked… either way there are several references to image uploads in the localsettings.php an didn’t want to over-crowd this post, so I copied it to:


First of all, as the directory structure of your installation is not readily apparent to me, I won’t attempt to tell you exactly what values you should be using for some of your configuration setting variables - you should carefully review your DefaultSettings.php and your LocalSettings.php files for correct paths and urls for your installation.

Remember that you should only change setting in LocalSettings.php, never in DefaultSettings.php; in essence, you “overwrite”, or supersede the values in DefaultSettings.php with an appropriate line in LocalSettings.php

There is excellent documentation on the use of LocalSettings.php, and the proper way to set the variables used in the file, in the MediWiki Manual section on Configuration Settings, and you should review that to make sure you have put the right “type” of value in each setting. :wink:

From the LocalSettings.php file you referred me to in your last post, I can see that part of your problem is that you have placed a URL in a place where a path is called for:

You have:

[quote]$wgUploadPath = ‘’;
$wgUploadDirectory = ‘’;[/quote]
$wgUploadPath appears to be correct (the URL of the upload directory). However, he reference I linked above clearly indicates that $wgUploadDirectory should be the “file system path” of the upload directory (and you have it entered as a URL, just as in the $wgUploadPath.

This is most likely what is producing your error message, as the program is trying to write to a “directory” that is not expressed in the manner expected (as a file system path). It’s especislly confusing, as the error message includes the “string” from the variable, and such a “location” does exist, and is writable (if that directory is set to 755). I think that makes the error message particularly misleading.

For what it’s worth, I also think it is very confusing, and non-intuitive, to require “file system paths” for variables named $wgxxxxDirectory while requiring URLS for variables named #wgxxxxPath , but that is MediaWiki’s convention (go figure! :open_mouth: ).

At any rate, that ought to get you on the right path to getting it sorted. I did not review other variables for a similar problem; I only looked at those relevant to the error message you reported. I suggest you carefully review them all, as I said at the beginning of this post. Good Luck!