Topic on Project:Support desk

how to run two wikis on the same server

1
Wikimalkindy (talkcontribs)

i followed the instruction on how to run two wikis on the same server using the one web server setup and it went well. my problem is with the LocalSettings.php since i do not understand php. the script is not able to select the right LocalSetting.php to run the wiki and i always get unknown wiki.


the server is with locally private address hosted. two separate LocalSettings_ar.php and LocalSettings_en.php for each wiki :


<?php

$wikis = [

    'earlyintervention.om' => 'ar_ewiki',

    'en.earlyintervention.om' => 'en_wiki',

];

if ( defined( 'MW_DB' ) ) {

    // Automatically set from --wiki option to maintenance scripts

    $wikiID = MW_DB;

} else {

    // Use MW_DB environment variable or map the domain name

    $wikiID = $_SERVER['MW_DB'] ?? $wikis[ $_SERVER['SERVER_NAME'] ?? '' ] ?? null;

}

if ( $wikiID ) {

    require_once "LocalSettings_$wikiID.php";

} else {

    die( 'Unknown wiki.' );

}

// Add any settings that should apply to all wikis below this line

// -------

Reply to "how to run two wikis on the same server"