I have an existing Media Wiki installation. It's a bit older -- currently at version 1.25.1.
We recently ran out of server disk space, so I added a large, storage-only disk that I'm now wanting to move our wiki's images over to. The image directory is easily the largest folder we have, so I was hoping to serve the images from this 2nd drive.
First, I rsync'd all images from /wiki/images/
to /symlinkToStorageDrive/images/
.
Second, I updated LocalSettings.php
like so:
$wgUploadPath = "/symlinkToStorageDrive/images";
$wgUploadDirectory = "/symlinkToStorageDrive/images";
Now, when I try to view any image in the wiki, I see this error:
Error creating thumbnail: File missing
However, I can manually browse to any of the images without error, so I know the apache web server is able to serve them as expected. I did try to invalidate the Mediawiki cache, but that did nothing.
I've been stumped on this for hours -- any ideas? Thanks!
Okay, this is probably just dumb on my part.
The paths used in in $wgUploadPath
and $wgUploadDirectory
must be relative from the Mediawiki install directory. The reason I previously thought this wasn't the case is because when I had previously used an absolute path from the server root, I saw the image path get resolved to http://<mydomain>/var/www/html/symlinkToStorageDrive/images
.
Obviously the /var/www/html shouldn't be there, so this made me assume I should define those settings as indicated above -- $wgUploadPath = "/symlinkToStorageDrive/images";
. Apparently, this is not the case because I finally resolved this by updating the properties like this:
$wgUploadPath = "../symlinkToStorageDrive/images";
$wgUploadDirectory = "../symlinkToStorageDrive/images";
Note, I also tried
$wgUploadPath = "$IP/../symlinkToStorageDrive/images";
but this does not work either, even though I would have expected that and the final resolution to be equivalent.