Okay, this might be a bit of a special situation, as I am using a single MediaWiki installation to serve multiple wikis.
I have a directory containing all of MediaWiki's files /var/www/common, and a directory containing the uploaded files for the wikis, /var/www/wiki1 and /var/www/wiki2 (both containing a subfolder "images"). Those directories are then aliased into the common directory through the Apache configuration.
My logo is placed in the respective upload directories, i.e. its on-disk filenames are /var/www/wiki1/images/logo.png and /var/www/wiki2/images/logo.png respectively.
LocalSettings contains this:
$wgUploadPath = "{$wgScriptPath}/images";
switch ($_SERVER['SERVER_NAME'])
{
case 'wiki1.example.org':
$wgUploadDirectory = "/var/www/wiki1/images";
break;
case 'wiki2.example.org':
$wgUploadDirectory = "/var/www/wiki2/images";
break;
default:
die('Unknown wiki');
}
$wgLogo = "{$wgUploadPath}/logo.png";This works - as in, the site displays correctly. However, MediaWiki seems to try to create an MD5 hash of the logo, I suppose for caching purposes. This ends up in my Apache error log:
PHP Warning: md5_file(/var/www/common/images/logo.png): failed to open stream: No such file or directory in /var/www/common/includes/OutputPage.php on line 3660 PHP Warning: OutputPage::transformFilePath: Failed to hash /var/www/common/images/logo.png [Called from OutputPage::transformFilePath in /var/www/common/includes/OutputPage.php at line 3662] in /var/www/common/includes/debug/MWDebug.php on line 311
It seems to me that transformFilePath is called incorrectly so that it does not resolve the image path correctly for the logo, while it does for other files (no error is written to the log). I realize that this might be difficult to fix since the logo does not necessarily have to be placed in the upload folder, but a simple fix might be to check if the logo is indeed placed there, and if so, resolve it the same way as uploaded images are.