Jump to content
MediaWiki

Local development quickstart

From mediawiki.org

This page is a quickstart guide to setting up a local development for MediaWiki using PHP and Composer.

This workflow is only suitable for local development. To serve a public website, see Manual:Installation requirements .

Install prerequisites

MediaWiki requires PHP 7.4.3+ and Composer 2.

Linux

On Ubuntu 22+ or Debian 11+, install the required packages using APT.

sudoaptinstall-yphpphp-intlphp-mbstringphp-xmlphp-apcuphp-curlphp-sqlite3composer

On Ubuntu 20, install PHP from APT, but install Composer from getcomposer.org/download.

sudoaptinstall-yphpphp-intlphp-mbstringphp-xmlphp-apcuphp-curlphp-sqlite3

On Fedora 35+, install the required packages using DNF.

sudodnfinstall-yphpcomposer

On Arch Linux, install the required packages using pacman.

sudopacman-Sphpcomposer--noconfirm

Mac

Install the required packages using Homebrew.

brewinstallphp@8.2composer
brewlinkphp@8.2

Windows

You have the option to use the Windows Subsystem for Linux and follow the Linux instructions on this page. Or, to install MediaWiki directly on Windows, install the required packages using Chocolatey.

choco install -y php composer

To load the required PHP extensions, edit your php.ini file, and uncomment the following lines. To find the location of php.ini, run php --ini, and look for Loaded Configuration File.

extension:fileinfo
extension:intl
extension:pdo_sqlite
extension:zip

Clone MediaWiki

Use Git to clone the MediaWiki core repository and the default skin.

gitclonehttps://gerrit.wikimedia.org/r/mediawiki/core.gitmediawiki
gitclonehttps://gerrit.wikimedia.org/r/mediawiki/skins/Vector.gitmediawiki/skins/Vector
cdmediawiki

Cloning MediaWiki takes a few minutes. While you're waiting, create a Wikimedia developer account if you don't already have one.

Install dependencies

From within your mediawiki directory, created above, use Composer to install MediaWiki's dependencies.

composerupdate

Install MediaWiki

Install MediaWiki with PHP's built-in SQLite database.

composermw-install:sqlite

Start server

Start PHP's built-in webserver, and open localhost:4000 in a browser to see your MediaWiki instance. To log in as an administrator , use username Admin and password adminpassword.

composerserve

Next steps

AltStyle によって変換されたページ (->オリジナル) /