Installation with shell access using Composer (MediaWiki 1.25+)
|This pages describes the installation using native Composer support|
|Image / Video collection|
|MediaWiki version:||1.25.0 and later|
|Table of Contents|
Use these instructions for a new Semantic MediaWiki installation in chronological order as they appear on this page.
php composer.phar require mediawiki/semantic-media-wiki "~2.5" --update-no-dev
composer require mediawiki/semantic-media-wiki "~2.5" --update-no-dev
"~2.5"(latest stable release) etc. Please always omit the bugfix release number, i.e. the third number with additional information about the
~usage can be found here.
composer requiredoes not work on this file and instead has to be edited manually.
Run maintenance scriptRun the setup script from the base directory3 of your MediaWiki installation:
If you get an error message similar to
mediawiki/semantic-media-wiki: 2.5.0 installed, ~2.5 required.
--skip-external-dependenciesto the call of the setup script.
Enable Semantic MediaWiki
Add a call to
enableSemantics() to the end of the "LocalSettings.php" file.
enableSemantics() takes in the domain name of the wiki; a wiki located at "example.org", for instance, should have the following call:
enableSemantics( 'example.org' );
require_once … must neither be added for Semantic MediaWiki nor for Validator since Composer loads the extensions automatically.
Add optional settings6 apart from one exception namely the Help:Configuration parameter "$smwgNamespaceIndex"7 to the "LocalSettings.php" file as desired below the
In case you want to use additional semantic extensions which are not installed via Composer like e.g. Semantic Drilldown you still have to invoke them by adding the respective line
require_once … to you "LocalSettings.php" file below the
Check and verify
Check the "Special:Version" page on your wiki and verify that the extension has been successfully installed and enabled.
Test your installation as described on the help page about testing SMW.
Use these instructions to update an existing SMW installation.
Backup your database and installation.
Run Composer update
php composer.phar update
Run maintenance script
Run the setup script from the base directory3 of your MediaWiki installation:
php extensions/SemanticMediaWiki/maintenance/rebuildData.php -d 50 -v
Check and verify
Check the "Special:Version" page on your wiki and verify that the extension has been successfully updated.
See the help page on upgrading from SMW 1.9+ for MW 1.22+
- Installation commands for Composer
- Example "composer.local.json" file
Installation with shell access using Composer (MediaWiki 1.25+) en 2.0
- This is necessary since starting with MW 1.25+ MediaWiki MediaWiki itself uses Composer to facilitate components and packages.
- Note that, if you have Git installed, it's recommended to install composer with the "--prefer-source" flag, so that Composer uses Git to download the code. In other words, instead of calling "composer update" or "php composer.phar update", as that page states, you should call "composer update --prefer-source" or "php composer.phar update --prefer-source".
- This is the directory which contains the "LocalSettings.php" file.
- In case you installed Composer "globally" on your server, you will have to drop the
.pharparticles from the command.
- Using composer-merge-plugin to "... allow local installs to use Composer to load optional libraries and/or manage extensions with Composer ... local deployment to add required extensions and libraries to a file composer.local.json inside the root MediaWiki directory"
- See the help page on configuring SMW. Usually only a few configuration parameters have to be changed if there is a need to do so at all.
- If you manually set
$smwgNamespaceIndexto something other than the default value of
100, you must do this above the enableSemantics() line instead. Make sure that the value set is ≥
100as well as an even number.
- rebuildData.php is an optional step to take to assure that the semantic store is valid and up to date