MediaWiki Version: 1.30
PHP Version: 5.6.36
MySQL Version: 5.6.39-cll-lve
In my Localsettings.php file I have been trying to configure a wiki family on my wiki, and it did not work well at the time. The site failed gracefully, leaving an error message saying that it was not possible to determine the wiki ID. Is there a way to fix this problem? What is wrong with the wiki family setup code? The code that the wiki had looked like this:
if ( defined( 'MW_DB' ) ) { ''// Set $wikiId from the defined constant 'MW_DB' that is set by maintenance scripts.'' $wikiId = MW_DB; } elseif (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] == 'wiki1.example.org') { ''// Add a value to the $wikiId variable for e.g. https://wiki1.example.org/'' $wikiId = 'wiki1'; } elseif (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] == 'example.org' && substr($_SERVER['REQUEST_URI'], 0, 6) == '/wiki2') { ''// Add a value to the $wikiId variable for e.g. https://example.org/wiki2'' $wikiId = 'wiki2'; } else { ''// Fail gracefully if no value was set to the $wikiId variable, i.e. if no wiki was determined'' die( 'It was not possible to determine the wiki ID.' ); }