Topic on Project:Support desk

Unable to run update.php

3
Swennet (talkcontribs)

I have several Wikis hosted on the same Mediawiki installation. I use the Giant Switch Statement (as described here: Manual:Wiki family) to achieve this. However, this seems to make me unable to run the update.php script.

In PuTTY I go to my maintainance folder as required and then I try running the php script from there using "php update.php". Then it gives me the following error:

PHP Notice:  Undefined index: SERVER_NAME in /var/www/html/w/LocalSettings.php on line 12

This wiki is not available. Check configuration.root@soulslike:/var/www/html/w/maintenance#

How should I go about updating my tables? I need to update them to install this extention (Extension:TitleKey) and will possibly need to use it in the future to update my Mediawiki installation. Also, I don't know why the Wiki would suggest the Giant Switch Statement at all if this causes errors in the Mediawiki updating process...

Swennet (talkcontribs)

UPDATE: I manually ran the update for each of my LocalSettings.php files by commenting out the Giant Switch Statement and temporarily including a LocalSettings file that was called by the Switch Statement. It was a bit of a time consuming fix but it did the trick.

88.130.65.86 (talkcontribs)

The wiki family page tells you to use $_SERVER['SERVER_NAME'] in the switch structure. However, the SERVER_NAME is not available when you run PHP from the CLI.

You should be able to use php_uname("n") instead.

Reply to "Unable to run update.php"