Spacemoose Spacemoose - 3 months ago 19
PHP Question

MediaWiki: How to Update.php maintenance script on wiki family?

I am running a MediaWiki wiki-family, with shared codebase and shared database. I recently succesfully upgraded to

1.25.3
.

My wiki got 4 prefixes atm, like so:

en_
de_
es_
shared_


I try to run my update.php script like so:

php update.php --wiki myWikiName-de_ --doshared
php update.php --wiki myWikiName-en_ --doshared
php update.php --wiki myWikiName-es_ --doshared


on my server. This should in theory work. Sadly it ALWAYS uses the
myWikiName-en_
and ignores my input..

PHP Notice: Undefined index: HTTP_HOST in /var/www/myWiki/wiki/LocalSettings.php on line 176
<br />
<b>Notice</b>: Undefined index: HTTP_HOST in <b>/var/www/myWiki/wiki/LocalSettings.php</b> on line <b>176</b><br />
MediaWiki 1.25.3 Updater

Your composer.lock file is up to date with current dependencies!
Going to run database updates for myWikiName-en_
Depending on the size of your database this may take a while!


Please someone tell me what i am doing wrong!

best regards,

Max

leo leo
Answer

Try setting SERVER_NAME=my.domain.org before running php update.php. The script might be looking for $_SERVER which, as you are running from the command line, is not available.