This is a brief installation and configuration guide for Semantic MediaWiki that only contains the core steps. More verbose installation instructions with additional explanation and upgrading instructions can be found here.
A list of supported PHP versions, MediaWiki versions and databases per SMW release can be found in the compatibility matrix.
The recommended way to install Semantic MediaWiki is with Composer using MediaWiki 1.22 built-in support for Composer. MediaWiki versions prior to 1.22 can use Composer via the Extension Installer extension.
If you have MediaWiki 1.22 or later, go to the root directory of your MediaWiki installation, and go to step 2. You do not need to install any extensions to support composer.
For MediaWiki 1.21.x and earlier you need to install the Extension Installer extension.
Once you are done installing the Extension Installer extension, go to its directory so composer.phar is installed in the right place.
cd extensions/ExtensionInstaller
If you have previously installed Composer skip to step 3.
To install Composer:
wget http://getcomposer.org/composer.phar
Now using Composer, install Semantic MediaWiki.
If you do not have a composer.json file yet, copy the composer-example.json file to composer.json. If you are using the Extension Installer extension, the file to copy will be named example.json, rather than composer-example.json. When this is done, run:
php composer.phar require mediawiki/semantic-media-wiki:@dev
@dev refers to the latest development version while selecting an appropriate version is at your discretion.
Run the MediaWiki update script. The location of this script is maintenance/update.php. It can be run as follows:
php maintenance/update.php
Add the following line to the end of your LocalSettings.php file.
enableSemantics( 'example.org' );
As final step, you can verify SMW got installed by looking at the "Special:Version" page on your wiki and verifying the Semantic MediaWiki section is listed.
As an alternative to installing via Composer, you can obtain the SMW code by getting one of the release tarballs. These tarballs include all dependencies of SMW.
This option exists mainly for those that have no command line access. A drawback of this approach is that it makes your setup incompatible with extensions that share dependencies with SMW. You are thus highly encouraged to use the Composer approach if you have command line access.
Download an SMW tarball and extract it into your extensions directory.
Add the following lines to the end of your LocalSettings.php file.
require_once "$IP/extensions/SemanticMediaWiki/SemanticMediaWiki.php";
enableSemantics( 'example.org' );
Log in as a user with administrator permission to your wiki and go to the page "Special:SMWAdmin":
- Click on the "Initialise or upgrade tables" button in the "Database installation and upgrade" section to setup the database.
- Click on the "Start updating data" button in the "Data repair and upgrade" section to activate the automatic data update.
As final step, you can verify SMW got installed by looking at the Special:Version page on your wiki and verifying the Semantic MediaWiki section is listed.