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 thebcmath 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.| Extension | Purpose |
|---|---|
calendar | Calendar conversion functions |
ctype | Character type checking (ctype_digit, etc.) |
dom | XML DOM manipulation |
fileinfo | MIME type detection for file uploads |
iconv | Character set conversion |
intl | Internationalization and locale support |
json | JSON encoding and decoding |
libxml | XML parsing foundation |
mbstring | Multibyte string handling |
openssl | Cryptography, HTTPS client support |
xml | Core XML parsing (xml_parser_create, etc.) |
xmlreader | Streaming XML reading |
Recommended PHP Extensions
These extensions are optional but strongly recommended for performance and functionality:| Extension | Benefit |
|---|---|
apcu | Faster web responses overall |
bcmath | Increased performance; required on 32-bit systems |
curl | Faster HTTP services (InstantCommons, Swift, Etcd) |
exif | Processing EXIF metadata in uploaded images |
gd | Thumbnail generation for file uploads |
gmp | Increased performance; alternative to bcmath on 32-bit |
igbinary | Faster serialization via igbinary |
imagick | ImageMagick integration for image manipulation |
memcached | Memcached caching backend |
mysqli | MySQL and MariaDB database driver |
pdo | SQLite database driver |
pgsql | PostgreSQL database driver |
posix | CLI concurrent processing (e.g. runJobs.php) |
pcntl | CLI concurrent processing (runJobs.php, rebuildLocalisationCache.php) |
readline | CLI history and autocomplete (eval.php and other REPLs) |
redis | Redis caching backend |
sockets | CLI concurrent processing (rebuildLocalisationCache.php) |
wikidiff2 | Faster text difference engine |
zlib | GZIP 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
- Nginx
- PHP Built-in Server
Apache 2.4+ with A basic virtual host configuration:MediaWiki ships with an
mod_php or PHP-FPM is the most common production setup.Enable mod_rewrite for clean URLs:.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 aftercomposer installis 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.