Skip to main content
MediaWiki 1.46 requires a web server with PHP, a supported database, and a small set of PHP extensions. This page describes the minimum and recommended requirements.
Always back up your database before attempting to install or upgrade MediaWiki.

PHP

MediaWiki 1.46 requires PHP 8.2.0 or higher. PHP versions below 8.2 are no longer supported by the PHP Group and will not receive security or bug fix updates. On 32-bit systems, either the bcmath or gmp extension is also required for scrambling Temporary Accounts.

Required PHP Extensions

All of the following extensions must be enabled. Most PHP distributions include them by default.
ExtensionPurpose
calendarCalendar conversion functions
ctypeCharacter type checking (ctype_digit, etc.)
domXML DOM manipulation
fileinfoMIME type detection for file uploads
iconvCharacter set conversion
intlInternationalization and locale support
jsonJSON encoding and decoding
libxmlXML parsing foundation
mbstringMultibyte string handling
opensslCryptography, HTTPS client support
xmlCore XML parsing (xml_parser_create, etc.)
xmlreaderStreaming XML reading
These extensions are optional but strongly recommended for performance and functionality:
ExtensionBenefit
apcuFaster web responses overall
bcmathIncreased performance; required on 32-bit systems
curlFaster HTTP services (InstantCommons, Swift, Etcd)
exifProcessing EXIF metadata in uploaded images
gdThumbnail generation for file uploads
gmpIncreased performance; alternative to bcmath on 32-bit
igbinaryFaster serialization via igbinary
imagickImageMagick integration for image manipulation
memcachedMemcached caching backend
mysqliMySQL and MariaDB database driver
pdoSQLite database driver
pgsqlPostgreSQL database driver
posixCLI concurrent processing (e.g. runJobs.php)
pcntlCLI concurrent processing (runJobs.php, rebuildLocalisationCache.php)
readlineCLI history and autocomplete (eval.php and other REPLs)
redisRedis caching backend
socketsCLI concurrent processing (rebuildLocalisationCache.php)
wikidiff2Faster text difference engine
zlibGZIP compression for SqlBagOStuff, $wgCompressRevisions, $wgUseFileCache

Database

One of the following database servers is required:

MariaDB 10.3+

The recommended choice for most deployments. Fully supported and widely used by Wikimedia.

MySQL 5.7.0+

Supported alongside MariaDB. Requires the mysqli PHP extension.

PostgreSQL 10+

Supported for production use. Requires the pgsql PHP extension.

SQLite 3.31.0+

Suitable for development and small wikis. Requires the pdo PHP extension.

Web Server

MediaWiki runs on Apache, Nginx, or PHP’s built-in development server.
Apache 2.4+ with mod_php or PHP-FPM is the most common production setup.Enable mod_rewrite for clean URLs:
a2enmod rewrite
A basic virtual host configuration:
<VirtualHost *:80>
    ServerName wiki.example.com
    DocumentRoot /var/www/html/wiki

    <Directory /var/www/html/wiki>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
MediaWiki ships with an .htaccess file that handles URL rewriting when AllowOverride All is set.

Memory and Disk

  • PHP memory limit: 128 MB minimum; 256 MB or more recommended for wikis with file uploads and extensions.
  • Disk space: At least 200 MB for the MediaWiki application files. Additional space is required for file uploads, database files (SQLite), and log files.
  • Composer dependencies: The vendor/ directory after composer install is approximately 150–200 MB.
If you are using SQLite, allocate sufficient disk space on the volume where $wgSQLiteDataDir (or the --dbpath passed to the installer) resides, as the entire database is stored as a single file.

Build docs developers (and LLMs) love