Help:Installation 1.9.0 - 1.9.2

This page describes how to install Semantic MediaWiki 1.9.0.x, 1.9.1.x and 1.9.2.x on a Linux-based server if you have shell access. There is also a help page on how to install on a Windows-based server. This is the strongly recommended installation method. If you do not have shell access. i.e. you cannot use Composer for installation and upgrading, you will have to install the file release as described on this help page on installing the file release of SMW. Please always check the exact requirements and follow the instructions carefully. Make sure you understand the legal disclaimer in the file COPYING before proceeding.

To upgrade a wiki running an older version of SMW, be sure to read the relevant section before starting the upgrade.

'''If you are using MediaWiki 1.23 and higher and/or PHP 5.4 and higher you are strongly encouraged to install or to update to Semantic MediaWiki 2.0 or higher. Semantic MediaWiki 1.9 is not recommended for productive use with these versions.'''

Requirements
This section lists the minimum requirements. See also the page on compatibility.


 * MediaWiki
 * MediaWiki 1.19+ though MediaWiki 1.22+ is recommended. If MediaWiki 1.19.x to 1.21.x is used then the Extension Installer extension 0.2.2+ is additionally required.


 * PHP
 * PHP 5.3.2+


 * Database
 * MySQL 5.0.2+ though MySQL 5.1+ is recommended (except 5.1.49 to 5.1.52) or
 * SQLite 3.7+ or
 * PostgreSQL 8.3+ though 8.4+ is recommended (beta-support only)

General notes

 * Semantic MediaWiki has dependencies that will made available during the installation.
 * Individual extensions to Semantic MediaWiki, e.g. Semantic Result Formats may have different requirements.
 * Individual extensions to Semantic MediaWiki may not be compatible with this release (yet). Please see those extensions' documentation pages, or contact the respective developers, for further information.
 * SMW uses the PHP mb_* multibyte functions such as mb_strpos in the php_mbstring.dll extension. This is standard but not enabled by default on some distributions of PHP. See the PHP manual for details.
 * For installation and upgrade, SMW needs the rights to create new tables and to alter tables . You can remove both rights after SMW is set up. The script "SMW_setup.php" can use the DB credentials from "LocalSettings.php" for this purpose, avoiding the need of extra rights for the wiki DB user.
 * When using the SQL backend (the default data store for SMW), SMW creates and alters temporary tables for certain semantic queries. To do this, the wiki's database user account must have privileges for CREATE TEMPORARY TABLES and DROP. If you don't wish to allow such privileges, you can disable these specific query features by adding the following to "LocalSettings.php":
 * When using a SPARQL backend, SMW uses the CURL functions of PHP. These functions may have to be enabled/installed to be available.

Installation

 * MediaWiki 1.22+
 * 1) Install Composer - please follow the instructions at installing Composer to do this.
 * 2) Run the installation script from the base directory of your MediaWiki installation:
 * 3) Run the setup script from the base directory of your MediaWiki installation:
 * 4) Add a call to   to the end of the "LocalSettings.php" file.   takes in the domain name of the wiki; a wiki located at "example.org", for instance, should have the following call:
 * The calls  must neither be added for Semantic MediaWiki nor for Validator since Composer loads the extensions automatically.
 * 1) Add optional settings apart from one exception to the "LocalSettings.php" file as desired below the   call.
 * 2) In case you want to use additional semantic extensions which are not installed via Composer like e.g. Semantic Forms you still have to invoke them by adding the respective line   to you "LocalSettings.php" file below the   call.
 * 3) See the page "Special:Version" on your wiki to verify that the extension is successfully installed.
 * 4) Test your installation as described on the help page about testing SMW.
 * 5) Done!
 * 1) See the page "Special:Version" on your wiki to verify that the extension is successfully installed.
 * 2) Test your installation as described on the help page about testing SMW.
 * 3) Done!


 * MediaWiki 1.22-alpha
 * This version contains a malfunctioning "composer.json" file and should not be used with SMW 1.9+. If you are using MW 1.22-alpha, you should first upgrade MediaWiki before doing the rest.


 * MediaWiki 1.19.x to 1.21.x
 * 1) Install the "Extension Installer" extension - see installing "Extension Installer" for how to do this.
 * 2) Add the following line to the "require" section of the "composer.json" file in the   directory.
 * 3) Run the installation script from the   directory:
 * 4) Run the setup script from the base directory of your MediaWiki installation:
 * 5) Add a call to   to the end of the "LocalSettings.php" file.   takes in the domain name of the wiki; a wiki located at "example.org", for instance, should have the following call:
 * The calls  must neither be added for Semantic MediaWiki nor for Validator since Composer loads the extensions automatically.
 * 1) Add optional settings apart from one exception to the "LocalSettings.php" file as desired below the   call.
 * 2) In case you want to use additional semantic extensions which are not installed via Composer like e.g. Semantic Forms you still have to invoke them by adding the respective line   to you "LocalSettings.php" file below the   call.
 * 3) See the page "Special:Version" on your wiki to verify that the extension is successfully installed.
 * 4) Test your installation as described on the help page about testing SMW.
 * 5) Done!
 * 1) In case you want to use additional semantic extensions which are not installed via Composer like e.g. Semantic Forms you still have to invoke them by adding the respective line   to you "LocalSettings.php" file below the   call.
 * 2) See the page "Special:Version" on your wiki to verify that the extension is successfully installed.
 * 3) Test your installation as described on the help page about testing SMW.
 * 4) Done!

Upgrading
Use these instructions to update an existing ≤ SMW 1.8.x installation from e.g. 1.8.0.5 to 1.9.0 etc.


 * Upgrading from SMW 1.8.x
 * 1) Backup your database and installation.
 * 2) Delete the directories   and   from the   directory.
 * 3) Remove the formerly required invocations of "Semantic MediaWiki" and "Validator" from the "LocalSettings.php" file, i.e. the following two lines:
 * 4) Re-install Semantic MediaWiki as described in the section on installing SMW.
 * 5) Run the refresh database script from the base directory of your MediaWiki installation:
 * 6) Done!
 * 1) Run the refresh database script from the base directory of your MediaWiki installation:
 * 2) Done!
 * 1) Done!


 * Upgrading from ≤ SMW 1.7.x

Please upgrade to SMW 1.8.0.5 first, as described on the help page on upgrading to SMW 1.8.x.

Updating SMW 1.9.x
Use these instructions to update an existing SMW 1.9 installation from e.g. 1.9.0 to 1.9.1 etc.


 * MediaWiki 1.22+
 * 1) Backup your database and installation.
 * 2) Run the update script from the base directory of your MediaWiki installation:
 * 3) See the page "Special:Version" on your wiki to verify that the extension was successfully updated.
 * 4) Run the setup script from the base directory of your MediaWiki installation:
 * 5) Run the refresh database script from the base directory of your MediaWiki installation:
 * 6) Done!
 * 1) Run the refresh database script from the base directory of your MediaWiki installation:
 * 2) Done!
 * 1) Done!


 * MediaWiki 1.19.x to 1.21.x
 * 1) Backup your database and installation.
 * 2) Run the update script from the   directory:
 * 3) See the page "Special:Version" on your wiki to verify that the extension was successfully updated.
 * 4) Run the setup script from the base directory of your MediaWiki installation:
 * 5) Run the refresh database script from the base directory :
 * 6) Done!
 * 1) Run the refresh database script from the base directory :
 * 2) Done!
 * 1) Done!

Troubleshooting
After the upgrade of an existing SMW installation the following messages can occur which solely depend on the configuration of the "LocalSettings.php" file:


 * Warning&#58; Class '…' not found in …
 * This kind of message appears if the Validator extension is still explicitly invoked. To resolve this the following line has to be removed:


 * Notice&#58; Use of undefined constant …
 * This kind of message appears because SMW namespace constants (,  and  ) are delayed due to the parameter   being a prerequisite and its initialization has to happen first it can be processed. To resolve this you have to add   prior to any parameter (e.g. $wgContentNamespaces, $wgNamespacesToBeSearchedDefault and $wgNamespaceProtection) making reference to these namespace constants. In case you choose to manually set   to something other than the default value of  , you must do this above the enableSemantics call.


 * Fatal&#58; Call to undefined function enableSemantics …
 * This kind of message appears for MW ≤ 1.21.x if the Extension Installer extension is included after the call to enableSemantics (see above). Make sure that the call to include Extension Installer comes first.

After updating an existing SMW 1.9.0 installation the following messages may occur:
 * Database error&#58; A database query error has occurred. This may indicate a bug in the software.
 * This error appears after an upgrade from SWM 1.9.0 to 1.9.1 when moving a page and if you have not updated the semantic store. To resolve this run the setup script from the base directory of your MediaWiki installation: