How does MediaWiki calculate file path?

I just install MediaWiki (love it). I look this one for adding images. I can use logic

[[File: MediaWiki: 50px Sample Image]]

but where do I set the path to the file "File" (nothing is visible in LocalSettings.php) ... or is there some other logic in the work?

Any help would be appreciated. Thanks

+7
image mediawiki
source share
4 answers

The file location is determined by $ wgLocalFileRepo , which by default depends on $ wgUploadDirectory and $ wgHashedUploadDirectory . The default download directory is [MediaWiki base dir]/images (Adrian must use an older version). If hashing is enabled , /x/xy will be added to the path, where xy is the first two letters of the md5 hash of the file name.

+10
source share

Default from DefaultSettings.php:

$ wgUploadPath = "$ wgScriptPath / uploads";
$ wgUploadDirectory = "$ IP / uploads";

If you want to change this, you must copy and paste it into LocalSettings.php

And make sure $wgEnableUploads = true; also located in LocalSettings.php.

+1
source share

"Sample Image" is the name of the image, not the name of the file. In the configuration file, you can simply set the root folder for downloading images.

0
source share

Just for future reference, if anyone else comes across this problem:

I installed MediaWiki on my Mac OS Sierra, and when I tried to download the image, I received the following message:

 Failed: Could not open lock file for "mwstore://local-backend/local-public/d/d9/babypicture.png". 

I changed the permissions in the mediawiki_root / images folder that will belong to the user and the _www group.

 chown -R _www:_www wiki/images 

I was able to upload the image later.

0
source share

All Articles