User:Tobias Gritschacher (WMDE)/Wikibase/Installation
This page provides a step-by-step instruction how to install a basic version of Wikibase. It just explains the minimal configuration needed for Wikibase. If you're interested in a more advanced configuration, please refer to the advanced configuration guide.
Prerequisites
[edit]MediaWiki
[edit]Technically, Wikibase is an extension (actually two extensions) to MediaWiki, so you need to set up MediaWiki first.
Composer
[edit]The easiest way to install all all dependencies of Wikibase is using Composer. Here you can find installation instructions for Composer.
Installation
[edit]A basic installation of Wikibase is pretty much straight forward and basically consists of 4 steps:
- getting Wikibase
- fetching dependencies
- modifying LocalSettings.php
- running some maintenance scripts.
The following guide will lead you through these steps.
Meet the prerequisites
[edit]Make sure you've set up MediaWiki and installed Composer.
Get Wikibase
[edit]Download Wikibase into the extensions folder of your MediaWiki installation. There are several ways to download Wikibase.
Download from Git
[edit]- For getting the latest version of Wikibase, do:
cd extensions
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase.git
- For getting a specific version of Wikibase you have to specify the branch you want to download:
cd extensions
git clone -b REL1_29 https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase.git
Download archive
[edit]- Instead of using Git you can alternatively download an archive with the latest version of Wikibase or choose to download a specific version of Wikibase.
- Make sure you extract the archive into a new folder inside the extensions folder of your MediaWiki installation.
Fetch all dependencies
[edit]- cd into Wikibase inside the extensions folder of your MediaWiki installation:
cd Wikibase
- If you've set up Composer correctly, you should be able to fetch all dependencies by running
composer install
or
php composer.phar install
depending on how Composer was installed on your machine.
Adjust your LocalSettings.php
[edit]Add the following lines to LocalSettings.php of your MediaWiki installation. You have three options, depending on whether you want to enable Wikibase Repository, Wikibase Client or both of them.
Enable Wikibase Repository only
[edit]$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = false;
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
Enable Wikibase Client only
[edit]$wgEnableWikibaseRepo = false;
$wgEnableWikibaseClient = true;
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";
Enable Wikibase Repository and Wikibase Client
[edit]$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = true;
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";
Run the setup scripts
[edit]Finally, you have to run some maintenance scripts.
For Wikibase Repository and Wikibase Client
[edit]- Run the database update script of your MediaWiki installation:
php maintenance/update.php
- Run the script that populates the sites table:
cd extensions/Wikibase
php lib/maintenance/populateSitesTable.php
For Wikibase Client only
[edit]- If you want to run a Wikibase Client, you'll also need to run the script that populates the interwiki table:
cd extensions/Wikibase
php client/maintenance/populateInterwiki.php
Verify your installation
[edit]Wikibase Repository
[edit]To verify your Wikibase Repository installation, in your MediaWiki go to Special:NewItem and you should be able to create your first Item. Enter a label and optional description and aliases and hit Create. You should be redirected to the item page.
Wikibase Client
[edit]If you've enabled Wikibase Client and everything is correct, you should see an "Add links" link in the languagelinks section in the sidebar of the main page.
For developers
[edit]An easy way so set up a developer environment for Wikibase, is to use the wikibase_repo role in MediaWiki-Vagrant. It sets up a plain Wikibase repo installation including all dependent components. It provides a quick way to get ready for hacking on Wikibase code. Sources of the Wikibase extension can be found under /mediawiki/extensions/Wikibase
and sources of dependent components are under /mediawiki/extensions/Wikibase/vendor
.