Last modified: 2006-07-12 05:23:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 6639 - $wgReadOnlyFile appears to default to non-existent directory
$wgReadOnlyFile appears to default to non-existent directory
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Normal minor (vote)
: ---
Assigned To: Rob Church
Depends on:
  Show dependency treegraph
Reported: 2006-07-12 02:02 UTC by Nick Jenkins
Modified: 2006-07-12 05:23 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Nick Jenkins 2006-07-12 02:02:29 UTC
$wgReadOnlyFile appears to default to non-existent directory.

Here's the problem I think:
root@bling:/var/www/hosts/mediawiki/wiki# grep -in wguploaddir
includes/DefaultSettings.php LocalSettings.php 
includes/DefaultSettings.php:119:$wgUploadDirectory     = "{$IP}/upload";
includes/DefaultSettings.php:124:$wgMathDirectory    = "{$wgUploadDirectory}/math";
includes/DefaultSettings.php:125:$wgTmpDirectory     = "{$wgUploadDirectory}/tmp";
includes/DefaultSettings.php:312: * $wgUploadDirectory.
includes/DefaultSettings.php:734:$wgReadOnlyFile         =
includes/DefaultSettings.php:1013:$wgFileCacheDirectory =
LocalSettings.php:56:$wgUploadDirectory  = "$IP/images";
LocalSettings.php:104:$wgMathDirectory    = "{$wgUploadDirectory}/math";
LocalSettings.php:105:$wgTmpDirectory     = "{$wgUploadDirectory}/tmp";

So, basically initially the default for $wgUploadDirectory is "{$IP}/upload"
(which doesn't exist in a default install, I think).

Then it gets overridden to be "$IP/images" in LocalSettings (which I don't
recall changing - I may have, but off the top of the head I don't think I did).

The problem is that this leaves the defaults for both $wgReadOnlyFile and
$wgFileCacheDirectory both using names in an "upload" directory that doesn't exist.

Or to put it a different way, this code:
$wgUploadDirectory     = "{$IP}/upload";
$wgMathDirectory    = "{$wgUploadDirectory}/math";
$wgTmpDirectory     = "{$wgUploadDirectory}/tmp";
$wgReadOnlyFile         = "{$wgUploadDirectory}/lock_yBgMBwiR";
$wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
$wgUploadDirectory  = "$IP/images";
$wgMathDirectory    = "{$wgUploadDirectory}/math";
$wgTmpDirectory     = "{$wgUploadDirectory}/tmp";

print   "wgTmpDirectory: $wgTmpDirectory\n"
      . "wgMathDirectory: $wgMathDirectory\n"
      . "wgUploadDirectory: $wgUploadDirectory\n"
      . "wgFileCacheDirectory: $wgFileCacheDirectory\n"
      . "wgReadOnlyFile: $wgReadOnlyFile\n";

...produces this result:
wgTmpDirectory: /images/tmp
wgMathDirectory: /images/math
wgUploadDirectory: /images
wgFileCacheDirectory: /upload/cache
wgReadOnlyFile: /upload/lock_yBgMBwiR

There are at least two ways of hopefully resolving this relatively painlessly:
* Either in the MediaWiki tarball that gets extracted, include an
empty/README-only "upload" directory (so that the path is valid by default, and
presumably no php code has to written or changed); Or:
* Change the value in DefaultSettings.php :
- includes/DefaultSettings.php:119:$wgUploadDirectory     = "{$IP}/upload";
+ includes/DefaultSettings.php:119:$wgUploadDirectory     = "{$IP}/images";

There's also the option of specifying $wgReadOnlyFile and $wgFileCacheDirectory
in LocalSettings, but that seems to defeat the purpose of defaultsettings
supplying default settings.
Comment 1 Rob Church 2006-07-12 03:19:52 UTC
Changed to use more consistent values in SVN trunk, r15559.
Comment 2 Nick Jenkins 2006-07-12 05:23:06 UTC
Thank you!

Note You need to log in before you can comment on or make changes to this bug.