Jump to navigation Jump to search
This page is a translated version of the page Manual:Update.php and the translation is 7% complete.
Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎čeština • ‎русский • ‎中文 • ‎日本語 • ‎한국어

"update.php" проверяет, если MediaWiki схема базы данных должна быть обновлена, чтобы работать с текущей версией mediawiki. Вы должны запустить update.php после каждого обновления mediawiki или после обновления, или установки расширения, которое требует обновления схемы. Для большинства расширений, которые требуют обновления схемы, это указано в их документации. You should run update.php after each upgrade of MediaWiki or after the update or install of an extension that requires a schema update. Most extensions that require schema updates will say so in their documentation.

Из браузера

Если Вы не имеете доступ к командной строке вашего сервера, можете использовать web updater, чтобы запустить скрипт обновления

Web updater

Из командной строки

Из командной строки, или SSH Shell:

  • Перейдите в директорию maintenance в директории, где расположена ваша wiki;
  • Запустите скрипт обновления:
  • Run the update script:
$ php update.php
Внимание Внимание: Обновление может завершиться с с ошибками, оставляя базу данных в несогласованном состоянии. Всегда делайте резервное копирование базы данных перед запуском скрипта. Always backup the database before running the script!

This maintenance script can be disabled via $wgAllowSchemaUpdates . People with extremely large and busy wikis may need to do upgrades with care, but if you're not sure if that applies to you, then it probably doesn't.
Use the following on Vagrant instances (from within your vagrant ssh).
$ mwscript update.php


This script offers several parameters (generic, script dependent and script specific) which may be required in some wiki environments.

Generic maintenance parameters
used to get a prompt of all available script parameters (generic, script dependent and script specific) together with short explanations of their usage. These are less often used parameters.
--wiki wikiId
update wiki family if database name depends on virtual host, where wikiId - database name (e.g. enwiki, dewiki ...)
Script specific parameters
skip countdown sequence
do not purge objectcache table. Normally update.php purges the objectcache table (generally contains the parser cache and the messages cache), msg_resource and msg_resource_links (these are used for ResourceLoader message caching and are cleared in 1.21 and later) tables in the database, if you don't want to purge this table, use the --nopurge option.
Update shared tables as well.
Run this script even if it is disabled by configuration options.
Specifies the config file (the LocalSettings.php file for the specific wiki). Used for wiki families.
All changes to the table structure or table additions are skipped. Only data changes are made.
No schema changes are made to the database, but the schema changes are saved to a separate SQL file that can be run.
Allows "update.php" to be run when $wgAllowSchemaUpdates is set to false. This is useful for non-WMF environments where strict DB permissions allow database updates (which "update.php" performs), but no schema changes (such as adding or dropping tables or indices which "update.php" also performs).
Skips compatibility checks
when using composer.local.json to let Composer install extensions and their dependencies, you may see an error message saying that there is a mismatch between the installed and required version (e.g. "mediawiki/semantic-breadcrumb-links: 1.3.0 installed, ~1.3 required"). You can use this parameter to ignore the message and run update.php regardless.
Внимание Внимание: Only recommended for use by developers.

Extensions can install/update their schemas using LoadExtensionSchemaUpdates hook.

See also