This page is a translated version of the page Manual:$wgReadOnly and the translation is 29% complete.
Maintenance scripts setting: $wgReadOnly
Laat bewerken niet toe, met de opgegeven string als reden.
Geïntroduceerd in versie:pre 1.1.0
Verwijderd in versie:nog steeds in gebruik
Toegelaten waardes:(string), null/false
Standaardwaarde:null (1.5.7+)
false (1.1.0-1.5.6)


Deze instelling is functioneel hetzelfde als $wgReadOnlyFile , maar gebruikt een string in plaats van een bestand.

If set to a string in the "LocalSettings.php" file, $wgReadOnly disallows editing, displaying the string given as the reason. The reason provided is preceded by the contents of MediaWiki:Readonlywarning.

$wgReadOnly = 'Deze wiki wordt momenteel bijgewerkt naar een nieuwe softwareversie. Probeer het over een paar uur nog eens.';

The above example locks the database and provides a default statement on edit pages and also gives the included string 'This wiki is currently being upgraded to a newer software version.' as an explanation for why the database was locked. Wikitext is allowed in this string and will be rendered when the read-only warning is shown which can be used to provide links or highlight upgrade notifications.

Waarschuwing Waarschuwing: In tegenstelling tot de naam, wordt de database niet alleen lezen! Zelfs wanneer $wgReadOnly is ingesteld kunnen extensies, API scripts en andere gebeurtenissen in het cache nog steeds data schrijven.


Since MediaWiki 1.27, running the upgrade script will not work if $wgReadOnly is set.

A simple solution is to set it to read only when not running from the command line, which will not affect the command line update script:

$wgReadOnly = ( PHP_SAPI === 'cli' ) ? false : 'This wiki is currently being upgraded to a newer software version. Please check back in a couple of hours.';


If sessions are not stored on an external caching system such as Redis or Memcached, users may get logged-out, and no further login attempts would succeed during the time the wiki is set read only, receiving a message similar to:

Er lijkt een probleem te zijn met uw aanmeldsessie. Uw handeling is gestopt uit voorzorg tegen een beveiligingsrisico (dat bestaat uit mogelijke "hijacking" van deze sessie). Probeer het formulier opnieuw te versturen.

DB caching

Caches that use the database cannot be written to during read only mode, which could prevent more than just editing (depending on the configuration, logging in or even viewing pages). This can be avoided by disabling cache, albeit at the cost of making your wiki slow. This can be accomplished with the following settings in LocalSettings.php:

$wgMessageCacheType = $wgMainCacheType = $wgParserCacheType = $wgSessionCacheType = CACHE_NONE;
$wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';

If you want your wiki to be fast, while still not using the DB, you should consider using something like Memcached. See $wgMainCacheType and $wgLocalisationCacheConf for details. If you want to enable logins while the database is readonly, at least $wgSessionCacheType needs to be set to some real non-DB caching mechanism.


When in read-only mode, images which need to be transformed or scaled will be shown as an error message instead of as an image. To avoid this problem, put the following in the "LocalSettings.php" file:

$wgIgnoreImageErrors = true;