Wikibase/Installation

Installation using Composer
The easiest way to install Wikibase is to use Composer to install all the dependencies.

First [//getcomposer.org/download get composer] by following [//getcomposer.org/doc/00-intro.md its installation guide]: Next clone the Wikibase Repository in the extensions folder of your MediaWiki installation:

or to work with gerrit:

Then run composer inside the folder of your Wikibase installation to get all dependencies:

If you plan to contribute to Wikibase and its components run the following command instead to also get the sources of the components:

After that adjust your LocalSettings.php to enable Wikibase. In order to enable a Wikibase Repository, insert the following:

To enable a Wikibase Client, insert the following instead:

You then need to run the database update script (in the folder of your MediaWiki installation):

And finally populate the sites table:

Note: If you're installing a client you'll need to populate the interwiki table too:

And make sure your wiki id is in the sites table, or simply changing it to one of the entries that is there by default:

That's it! Wikibase should now be installed in your MediaWiki.

Installation without composer
If you cannot install Wikibase using composer for any reason, there are nightly builds on labs: bene/wikibase. Download the build in one of the available formats and unpack it into the  folder. However, using composer is encouraged because it simplifies updating a lot.

Vagrant
There is a Wikidata role in MediaWiki-Vagrant which installs Wikibase using the Wikidata Build Resources. The build resources are same as used for Wikidata, itself, including related components like the Property Suggester and badges components. In vagrant, everything is installed using composer's --prefer-source option so that you can make changes in Wikibase or other components and submit the changes.

Troubleshooting
If you get an error like "Invalid callback Wikibase\RepoHooks::onSetupAfterCache", then this is probably because you enabled Wikibase but didn't run  yet. (and then run update.php again to install Wikibase tables)

[85c536d8] /wiki/Main_Page? MWException from line 184 of /Library/WebServer/Documents/php-master/includes/Hooks.php: Invalid callback Wikibase\RepoHooks::onSetupAfterCache in hooks for SetupAfterCache Backtrace:


 * 1) 0 /Library/WebServer/Documents/php-master/includes/Setup.php(587): Hooks::run(string)
 * 2) 1 /Library/WebServer/Documents/php-master/includes/WebStart.php(121): require_once(string)
 * 3) 2 /Library/WebServer/Documents/php-master/index.php(43): require(string)
 * 4) 3 {main}