Last modified: 2008-06-23 23:21:48 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 14628 - Determination of $IP prevents use of maintenance scripts with wikis based on symlinks
Determination of $IP prevents use of maintenance scripts with wikis based on ...
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2008-06-23 22:59 UTC by Cymen Vig
Modified: 2008-06-23 23:21 UTC (History)
1 user (show)

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


Description Cymen Vig 2008-06-23 22:59:17 UTC
The calculation of $IP in when running maintenance scripts always goes to the real installation of Mediawiki instead of using the current settings in LocalSettings.php. We have multiple wikis installed with the core MW install symlinked to each with only a few non-symlinked files (LocalSettings.php and images). This works very well except we can't run maintenance scripts on each Wiki -- doing "php maintenance/generateSitemap.php" or "php maintenance/update.php" (on an upgrade) fail when one is in the wiki root directories with:

A copy of your installation's LocalSettings.php
must exist and be readable in the source directory.

And printing out $IP from makes it clear that IP points to the core install of MW. A work around is to copy each wiki's LocalSettings.php to the core directory, run the maintenance script and then remove the LocalSettings.php. Perhaps there is a better way to avoid this problem (and do multiple wikis) but it seems like a check in for a LocalSettings.php in the current working directory (and using the $IP value from that file by default) would solve the problem.
Comment 1 Daniel Friesen 2008-06-23 23:15:03 UTC
For this purpose, the --conf= parameter exists already. If you have a symlink based installation as I do to, just use --conf= to specify the location of the LocalSettings.php file to use and it'll work from there.

Additionally, I already cleaned this up even more as of 1.13.
As per one of tim's suggestions when discussing the issues with extensions using maintenance scripts. I introduced a MW_INSTALL_PATH environment variable.

From 1.13 on you can use that environment variable to make this work perfectly fine. My personal favorite, is to cd to my root directory, run `export MW_INSTALL_PATH=$PWD` and from there, when in a 1.13 wiki the install path will be perfectly fine even though 100% of my wiki run off symlinks. Of course, 99% of my wiki are 1.12, so my scripts have the --conf= specified as well. But nonetheless, symlink installations work perfectly fine.
Comment 2 Cymen Vig 2008-06-23 23:21:48 UTC
Thank you! I'm new to the MW code and I completely missed that option existed.

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