Regrettably, due to spawning of spam pages - only registered users may make edits.

Extenstion Installation

From WhatNotWiki
Jump to: navigation, search

Installing an extension

Most of this page is a copy of the Manual:Extensions - MediaWiki page. I've dome minor edits.


  1. Before you start
    A few extensions require the installation of a patch. Many of them also provide instructions designed for installation using unix commands. You require shell access (SSH) to enter these commands listed on the extension help pages.
  2. Download your extension.
    Extension Distributor helps you to select and download most of the popular extensions.
    Extensions are usually distributed as modular packages. They generally go in their own subdirectory of $IP/extensions/. A list of extensions stored in the Wikimedia Git repository is located at git:mediawiki/extensions. Some extensions are available as source code within this wiki. You may want to automate copying them.
    Unofficial bundles of the extensions in the Wikimedia Git repository can be found on the toolserver. These bundles are arbitrary snapshots, so keep in mind they might contain a broken version of the extension (just as if you load them from the developer's repository directly).
  3. Install your extension.
    Generally, at the end of the LocalSettings.php file (but above the PHP end-of-code delimiter, "?>", if present), the following line should be added:
    <syntaxhighlight lang="php">require_once "$IP/extensions/extension_name/extension_name.php";</syntaxhighlight>
    This line forces the PHP interpreter to read the extension file, and thereby make it accessible to MediaWiki.
    Some extensions can conflict with maintenance scripts, for example if they directly access $_SERVER (not recommended).
    In this case they can be wrapped in the conditional so maintenance scripts can still run.

<syntaxhighlight style="margin-left:4.5em" lang="php">if (!$wgCommandLineMode) {

  require_once "$IP/extensions/extension_name/extension_name.php";

} </syntaxhighlight>


The maintenance script importDump.php will fail for any extension which requires customized namespaces which is included inside the conditional above such as Extension:Semantic MediaWiki, Extension:Semantic Forms.
{{ Template:TNTN |Ensure that required permissions are set for extensions!}}
{{ Template:TNTN |While this installation procedure is sufficient for most extensions, some require a different installation procedure. Check your extension's documentation for details.}}
{{ Template:TNTN |If you want to alter configuration variables in LocalSettings.php, you have to do this typically after including the extension. Otherwise defaults defined in the extension will overwrite your settings.}}
{{ Template:TNTN |While extension declaration can be placed in other places within the LocalSettings.php file, never place extensions before the require_once "includes/DefaultSettings.php"; line for MediaWiki versions below 1.17 . Doing so will blank the extension setup function arrays, causing no extensions to be installed, and probably will make your wiki inaccessible until you fix it!}}