Skip to content

Work with MediaWiki

Releasev0.35.0 · cfeceb67

Watch it in action

Query a local wiki API

You can get a shell as your current user in the main MediaWiki container easily:

mw dev mediawiki exec bash

You can use the exec command to perform actions inside the MediaWiki container as a one off…

Such as, watching logs

mw dev mediawiki exec -- tail -f /var/log/mediawiki/debug.log

Automatic dependency setup during installation, recipes and update-code --composer retries explicit DNS, connection and download-timeout failures up to three attempts, waiting 2 seconds and then 5 seconds between attempts. Output stays visible, and messages show when another attempt is starting. Composer may also retry individual requests internally.

Dependency conflicts, invalid configuration and script failures still stop the operation. A failed Composer update stops installation before the database stage. If network failures persist, check DNS and connectivity inside the MediaWiki container before rerunning the command. The explicit mw dev mediawiki composer command passes through to Composer without this additional retry policy.

You can run PHPUnit tests in the MediaWiki container easily:

mw dev mediawiki exec -- composer phpunit tests/phpunit/unit/includes/XmlTest.php

You may still need to use the old phpunit.php test running for some PHPUnit tests!

mw dev mediawiki exec -- php tests/phpunit/phpunit.php tests/phpunit/unit/includes/xml/XmlTest.php

If you want to run tests with the debugger, see the XDebug section below.

See debug PHP with Xdebug for IDE setup, triggers, container settings and troubleshooting. Use Fresh to run browser tests and record Selenium videos.


Read this guide offline with mw help guides dev mediawiki.

Adapted from MediaWiki.org under CC BY-SA 4.0; see the linked page history for contributors.

Report an issue with this page

Report a documentation issue

The report includes this page’s link, section and documentation version.

Review and submit on Phabricator, or run the command using your saved CLI profile. The command asks before creating the task.