mediawiki DBLoadBalancer error while setting up wi

2019-09-14 09:54发布

问题:

I've just installed MediaWiki 1.28 on arch linux with nginx 1.10.3, php 7.1.1, php-fpm, and sqlite 3.16.2. I followed the arch wiki guide: https://wiki.archlinux.org/index.php/MediaWiki. I've installed the required PHP extensions and PHP, sqlite, nginx all seem to run fine on their own.

Now when I'm trying to do the setting up LocalSettings.php part of the MediaWiki installation, I go to 0.0.0.0/mediawiki in the browser, click the setup and get the error below. Maybe it's a setting for sqlite that has to be enabled?

[1449c8c65e65734059748f4e] /mw-config/index.php MediaWiki\Services\ServiceDisabledException from line 340 of /usr/share/webapps/mediawiki/includes/services/ServiceContainer.php: Service disabled: DBLoadBalancer

Backtrace:

#0 /usr/share/webapps/mediawiki/includes/MediaWikiServices.php(509): MediaWiki\Services\ServiceContainer->getService(string)
#1 /usr/share/webapps/mediawiki/includes/GlobalFunctions.php(3089): MediaWiki\MediaWikiServices->getDBLoadBalancer()
#2 /usr/share/webapps/mediawiki/includes/GlobalFunctions.php(3075): wfGetLB(boolean)
#3 /usr/share/webapps/mediawiki/includes/cache/LinkCache.php(267): wfGetDB(integer)
#4 /usr/share/webapps/mediawiki/includes/Title.php(3184): LinkCache->addLinkObj(Title)
#5 /usr/share/webapps/mediawiki/includes/Title.php(934): Title->getArticleID(integer)
#6 /usr/share/webapps/mediawiki/includes/content/ContentHandler.php(282): Title->getContentModel()
#7 /usr/share/webapps/mediawiki/includes/Title.php(4684): ContentHandler::getForTitle(Title)
#8 /usr/share/webapps/mediawiki/includes/parser/Parser.php(867): Title->getPageLanguage()
#9 /usr/share/webapps/mediawiki/includes/parser/Parser.php(2110): Parser->getTargetLanguage()
#10 /usr/share/webapps/mediawiki/includes/parser/Parser.php(2075): Parser->replaceInternalLinks2(string)
#11 /usr/share/webapps/mediawiki/includes/parser/Parser.php(1290): Parser->replaceInternalLinks(string)
#12 /usr/share/webapps/mediawiki/includes/parser/Parser.php(441): Parser->internalParse(string)
#13 /usr/share/webapps/mediawiki/includes/installer/Installer.php(675): Parser->parse(string, Title, ParserOptions, boolean)
#14 /usr/share/webapps/mediawiki/includes/installer/WebInstaller.php(681): Installer->parse(string, boolean)
#15 /usr/share/webapps/mediawiki/includes/installer/WebInstaller.php(657): WebInstaller->getInfoBox(string, string, string)
#16 /usr/share/webapps/mediawiki/includes/installer/WebInstaller.php(401): WebInstaller->getErrorBox(string)
#17 /usr/share/webapps/mediawiki/mw-config/index.php(54): WebInstaller->showError(Message, string)
#18 /usr/share/webapps/mediawiki/mw-config/index.php(38): wfInstallerMain()
#19 {main}

回答1:

The problem was I had my php/sessions directory in /tmp. I moved it to session.save_path = "/var/lib/php/sessions" in php.ini and repeated these steps:

mkdir -p /var/lib/php/sessions
chown http:http /var/lib/php/sessions
chmod go-rwx /var/lib/php/sessions


回答2:

Regardless of what Tgr said above, fixing the sessions did fix the issue for me. I'm using Apache ITK so the resolution I use is slightly different since each virtual host runs under its own unique uid.

First I create a separate directory for the sessions and change ownership

mkdir /var/lib/php/sessions-wiki
chown wiki. /var/lib/php/sessions-wiki

Then in my VirtualHosts directive I tell Apache/php where to find the session files by adding

php_admin_value session.save_path "/var/lib/php/sessions-wiki"

Then to make sure your config didn't break it.

apachectl configtest 

Finally reload your config

apachectl graceful


标签: mediawiki