LocalSettings.php: Unterschied zwischen den Versionen

Aus Foxwiki
Wechseln zu:Navigation, Suche
Die Seite wurde geleert.
Markierung: Geleert
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
<languages/>
{{BOMWarning}}
{{MW file|LocalSettings.php|NotInGit=<translate><!--T:103--> created during installation</translate>}}


<translate><!--T:1--> The <tvar name=1>'''<code>LocalSettings.php</code>'''</tvar> file provides basic [[<tvar name=2>Special:MyLanguage/Manual:Configuration settings</tvar>|configuration settings]] of a <tvar name=5>{{ll|MediaWiki}}</tvar> installation.</translate>
<translate><!--T:122--> You should take your time to review the settings in this file.</translate>
<translate><!--T:123--> The file is usually generated by the web-based MediaWiki installer but you can tweak the parameters, possibly in concert with Apache settings.</translate>
<translate><!--T:124--> For MediaWiki installations configured as a [[<tvar name=2>Special:MyLanguage/Manual:Wiki family</tvar>|wiki farm]], a file named <tvar name=1><code>{{ll|Manual:CommonSettings.php|CommonSettings.php}}</code></tvar> may be used.</translate>
<translate>
== Location on the server == <!--T:2-->
</translate>
<translate><!--T:3--> The <tvar name="1"><code>LocalSettings.php</code></tvar> file is not a wiki page, and you cannot access it with your web browser.</translate>
<!-- there were multiple(!) people assuming on the talk page that it _was_ a wiki page or at least web accessible -->
<translate><!--T:130--> Instead, it is a file in the file system of the server.</translate>
<translate><!--T:131--> Its contents are generated during the initial setup of the wiki, and the resulting file must be copied to the server manually.</translate>
<translate><!--T:132--> The file must be located in the folder you installed MediaWiki into, on the same level with folders like <tvar name="1"><code>includes/</code></tvar> and <tvar name="2"><code>skins/</code></tvar> and files like <tvar name="3"><code>api.php</code></tvar>.</translate>
<translate><!--T:133--> If this file is ''not'' there, the wiki will not work at all—if the wiki ''does'' work, the file ''is there''.</translate>
<translate><!--T:134--> If you do not know where it is, you can enter a command such as <tvar name=1><code>find / -iname LocalSettings.php -print</code></tvar> in a terminal window to locate it.</translate>
<translate>
<!--T:110-->
(If you are using Vagrant, see also [[<tvar name=vagrant>Special:MyLanguage/MediaWiki-Vagrant#mw-settings</tvar>|MediaWiki-Vagrant#MediaWiki_settings]].)
== Security == <!--T:4-->
</translate>
<translate><!--T:5--> <tvar name="1"><code>LocalSettings.php</code></tvar> usually contains sensitive data such as database logins.</translate>
<translate><!--T:135--> This data should ''never'' be revealed to the public!</translate>
<translate><!--T:136--> Due to a security breach somewhere on the server, it might happen that other users are able to view the contents of files.</translate>
<translate><!--T:137--> In order to improve security of your data, you should set UNIX permissions for this file accordingly: The webserver user must have access to this file.</translate>
<translate><!--T:138--> If this is the same account, who is the owner of the file, then you can set permissions to ''600''.</translate>
<translate><!--T:139--> Sometimes, the webserver user is ''not'' the file owner, but they are in the owner's UNIX user group.</translate>
<translate><!--T:140--> In this case, permissions of ''640'' should be fine. For improved security you should narrow permissions down as far as possible.</translate>
<translate>
<!--T:6-->
Additionally, you can create a MySQL user, who is restricted to only the database used by the wiki and provide this user's credentials in <tvar name="1"><code>LocalSettings.php</code></tvar>. Also you can configure your database server to only accept connections from localhost - this should prevent access from outside in case of leaked credentials.
<!--T:146-->
See also <tvar name=1>{{ll|Manual:Securing database passwords}}</tvar> for a method to move the sensitive parts of <tvar name=2><code>LocalSettings.php</code></tvar> to a different file in a different directory.
== File contents == <!--T:7-->
<!--T:8-->
When you edit <tvar name="1"><code>LocalSettings.php</code></tvar>, make sure to save it in the right encoding again. You should use "ANSI as UTF-8" encoding - that is UTF-8 encoding without byte order mark (BOM).
<!--T:9-->
<tvar name="1"><code>LocalSettings.php</code></tvar> contains [[w:PHP|PHP code]]; mainly the definition of variables and their values. Changing a setting usually means changing the value of a PHP variable. Your changes will take effect immediately after saving the file again on the server: There is no need to manually "restart" anything, although in some cases you may need to clear your browser's cache to actually see the changes you made.
</translate>
<translate><!--T:10--> The ''default'' values of configuration settings are set in <tvar name="1"><code>includes/MainConfigSchema.php</code></tvar>, ''which should not be edited''; if the variable you want to change is not already mentioned in your <tvar name=2><code>LocalSettings.php</code></tvar>, add a line to that file and modify it appropriately.</translate>
'''<translate><!--T:157--> Within <tvar name=1><code>LocalSettings.php</code></tvar> you can add new lines at the end.</translate>'''
{{tmpl|0=<translate><!--T:11--> Within the file, there can also be several lines such as <tvar name=1>$1</tvar> or <tvar name=2>$2</tvar>, which point to [[<tvar name=ext-content>Special:MyLanguage/Extension:Contents</tvar>|extensions]].</translate>
|1={{tmpl|0=<code class="mw-highlight"><!--
-->{{#tag:span|require_once|class=k}} {{#tag:span|"|class=s2}}{{#tag:span|$IP|class=si}}{{#tag:span|/extensions/|class=s2}}'''''$1'''''{{#tag:span|.php"|class=s2}};</code>
  |1=<translate><!--T:177--> ExtensionName</translate>
  }}
|2={{tmpl|0=<code class="mw-highlight"><!--
-->{{#tag:span|wfLoadExtension|class=nx}}( {{#tag:span|'|class=s1}}'''''$1'''''{{#tag:span|'|class=s1}} )</code>
  |1=<translate><!--T:178--> ExtensionName</translate>
  }}
}}
<translate><!--T:158--> These lines enable the corresponding extension in the wiki.</translate>
<translate><!--T:159--> Those extensions may require setting the values of more variables in <tvar name="1"><code>LocalSettings.php</code></tvar>; check the documentation of the extension itself for further instructions.</translate>
<translate>
<!--T:13-->
Like most PHP files in MediaWiki, <tvar name="1"><code>LocalSettings.php</code></tvar> does not end with the closing PHP tag <tvar name=code>{{phpi|?>}}</tvar>. This prevents admins from accidentally adding new information ''after'' this tag. PHP works fine without a closing tag.
<!--T:14-->
If you have a wiki on a MediaWiki [[w:wiki farm|wiki farm]] you may not have write-access (perhaps not even read-access) to the file <tvar name="1"><code>LocalSettings.php</code></tvar> (see e.g. <tvar name=wikiaforum>[http://community.wikia.com/wiki/Forum%3ALocalSettings.php%3F]</tvar>). The wiki farm company may or may not be willing to make changes you desire. Perhaps it wants to keep most settings the same on all wikis of the wiki farm.
</translate>
{{note|1=<translate><!--T:15--> This file is not written to your webserver automatically for security reasons. Instead, it is offered as a download, which you must then upload to your server for your wiki to begin working. For a more complete explanation, see [<tvar name=installer>//www.mediawiki.org/w/index.php?title=New-installer_issues&diff=334526&oldid=333913</tvar> this explanation].</translate>}}
<translate>
== Overview of available settings == <!--T:16-->
<!--T:17-->
See the [[<tvar name=config>Special:MyLanguage/Manual:Configuration settings</tvar>|configuration settings index]] and the comments included in the settings files for help on what all the variables do. A short listing of the most important variables, as well as the most requested features, is listed below.
==Standard settings== <!--T:18-->
===Install path=== <!--T:19-->
</translate>
<translate><!--T:20--> The <tvar name=1>'''{{ll|Manual:$IP|$IP}}'''</tvar> (install path) variable holds the local file path to the base installation of your wiki.</translate>
<translate><!--T:147--> Since MediaWiki 1.18, the system sets <tvar name=1>$IP</tvar> automatically.</translate>
<translate><!--T:148--> Setting <tvar name=1>{{phpi|$IP}}</tvar> manually in <tvar name=2><code>LocalSettings.php</code></tvar> is no longer needed.</translate>
<translate><!--T:149--> <tvar name=1>{{phpi|$IP}}</tvar> will default to the current working directory and can be used without the need to manually define it.</translate>
<translate><!--T:160--> Attempting to set <tvar name="1">{{phpi|$IP}}</tvar> (or <tvar name="2"><code>MW_INSTALL_PATH</code></tvar>) in <tvar name="3"><code>LocalSettings.php</code></tvar> may produce unexpected results.</translate>
<translate>
===Site name=== <!--T:22-->
<!--T:23-->
<tvar name=1>'''{{ll|Manual:$wgSitename|$wgSitename}}'''</tvar> holds the name of your wiki setup. This name gets included many times throughout the system, such as via MediaWiki:Pagetitle. For instance, the Wikipedia tagline "From Wikipedia, the free encyclopedia" makes use of this setting.
=== Declensions of site name === <!--T:24-->
</translate>
<translate><!--T:25--> Some translations of interface are ready for inflection of site name.</translate>
<translate><!--T:117--> You can set proper forms of word in variables <tvar name=1>'''{{ll|Manual:$wgGrammarForms|$wgGrammarForms}}'''</tvar> (for example please refer to the <tvar name=2>'''{{ll|Manual:$wgSitename|$wgSitename}}'''</tvar> documentation page).</translate>
<translate>
===Script path=== <!--T:28-->
</translate>
<translate><!--T:29--> <tvar name=1>'''{{ll|Manual:$wgScriptPath|$wgScriptPath}}'''</tvar> is the URL path prefix to access the main MediaWiki script that is the central acting piece of code of MediaWiki.</translate>
<translate><!--T:116--> This setting should correspond to the [[<tvar name=1>Special:MyLanguage/Apache configuration</tvar>|Apache settings]], especially if you are using Apache's [[w:Rewrite_engine|rewrite]] rules.</translate>
<translate>
===Server name=== <!--T:30-->
<!--T:31-->
<tvar name=Server>'''{{ll|Manual:$wgServer|$wgServer}}'''</tvar> contains the base URL of the server, including protocol but without the trailing slash and without the subdirectory if any. When the wiki is accessed from either the localhost where it runs, from an intranet or from the internet, email notifications and a few other computed messages would be usually delivered with the different URLs.
</translate>
<translate><!--T:111--> From MediaWiki 1.34 <tvar name=1>{{phpi|$wgServer}}</tvar> must be set in <tvar name=2>LocalSettings.php</tvar>.</translate>
<translate><!--T:112--> Prior to that, MediaWiki tried to autodetect the name of the server and <tvar name=1>{{phpi|$wgServer}}</tvar> was optional, to override the autodetection.</translate>
<translate>
<!--T:32-->
If www.example.com is the server address of your wiki as seen from the internet, add a line such as
</translate>
<syntaxhighlight lang="php">
$wgServer = 'http://www.example.com';
</syntaxhighlight>
<translate>
<!--T:33-->
The [[<tvar name=1>Special:MyLanguage/Help:Magic words#Page names and related info</tvar>|magic word]] variable <tvar name=2><code><nowiki>{{SERVER}}</nowiki></code></tvar> can be used on wiki pages; it equals the value of <tvar name=3>{{phpi|$wgServer}}</tvar>; however, on a wiki, such as those in the Wikimedia family, where relative urls are used, it will not fully expand, for example here it displays <tvar name=4>{{SERVER}}</tvar>, which can neither be clicked nor copy-pasted into the address bar as it is.
</translate>
<translate><!--T:154--> You can also use a protocol relative URL as shown below.</translate>
<translate><!--T:161--> When using a protocol relative URL, be sure to set <tvar name="1">{{phpi|$wgCanonicalServer}}</tvar>.</translate>
<translate><!--T:162--> <tvar name="1">{{phpi|$wgCanonicalServer}}</tvar> is needed for some places in the code where an origin with a protocol and hostname is needed.</translate>
<syntaxhighlight lang="php">
$wgServer = '//www.example.com';
$wgCanonicalServer = 'https://www.example.com';
</syntaxhighlight>
<translate>
===Script name=== <!--T:34-->
<!--T:35-->
<tvar name=Script>'''{{ll|Manual:$wgScript|$wgScript}}'''</tvar> is the name of the main (index) MediaWiki PHP script, named <tvar name="1"><code>index.php</code></tvar> by default. Changing the script name is probably not a good idea. However, if you feel the urge to do so, this is the place to make your changes. Make sure you know what you are doing.
===Article path=== <!--T:38-->
</translate>
<translate><!--T:39--> <tvar name=ArticlePath>'''{{ll|Manual:$wgArticlePath|$wgArticlePath}}'''</tvar> is the path to use when accessing a page in MediaWiki.</translate>
<translate><!--T:153--> The path should contain the path to the main script (usually making use of <tvar name=1>{{phpi|$wgScript}}</tvar>) and use the <tvar name=2><code>$1</code></tvar> placeholder for the article name.</translate>
<translate><!--T:40--> If you are using Apache rewrite rules to create pretty and short URLs, you probably need to adjust <tvar name=1>{{phpi|$wgArticlePath}}</tvar> to address the right path.</translate>
<translate><!--T:150--> Note that <tvar name=1>wgArticlePath</tvar> is used to construct URLs from within MediaWiki.</translate>
<translate><!--T:151--> If you make a mistake here, internal links will show up incorrectly while you still may be able to access the main page by specifying the correct URL manually.</translate>
<translate><!--T:152--> See <tvar name=1>{{ll|Manual:Short URL}}</tvar> for more information on URL configuration.</translate>
<translate>
<!--T:41-->
Typical values are:
</translate>
{| class="wikitable"
| <code>"$wgScript/$1"</code>
| <translate><!--T:104--> pass the article name with separator "/"</translate>
|-
| <code>"$wgScript?title=$1"</code>
| <translate><!--T:105--> pass the article name as a parameter (old style)</translate>
|-
| <code>"/mypath/$1"</code>
| <translate><!--T:106--> custom path. Use Apache rewrite rules to convert "mypath" to the proper path accessing the main script</translate>
|}
<translate>
===Stylesheet location=== <!--T:43-->
</translate>
<translate><!--T:44--> Use <tvar name=1>'''{{ll|Manual:$wgStylePath|$wgStylePath}}'''</tvar> to set the URL path to the place where the stylesheets (CSS) for the MediaWiki installation are located.</translate>
<translate><!--T:126--> <tvar name=1>'''{{ll|Manual:$wgStyleDirectory|$wgStyleDirectory}}'''</tvar> should point the same place, but note that this is a local file system path for use in internal scripts accessing the file system.</translate>
<translate>
===Upload location=== <!--T:45-->
<!--T:46-->
The upload directory is the place where files uploaded by the users are stored. <tvar name=1>'''{{ll|Manual:$wgUploadPath|$wgUploadPath}}'''</tvar> specifies the URL path, <tvar name=2>'''{{ll|Manual:$wgUploadDirectory|$wgUploadDirectory}}'''</tvar> points to the local file system path.
===Logo=== <!--T:47-->
<!--T:48-->
<tvar name=Logo>'''{{ll|Manual:$wgLogos|$wgLogos}}'''</tvar> specifies which graphical logos are displayed in the top left corner of the page in most MediaWiki installations.
<!--T:170-->
See <tvar name="1">{{ll|Manual:FAQ#How do I change the logo?}}</tvar> for how to change the logo.
===Contact info=== <!--T:54-->
<!--T:55-->
<tvar name=EmergencyContact>'''{{ll|Manual:$wgEmergencyContact|$wgEmergencyContact}}'''</tvar> is the email address of the user to contact if something goes wrong. This email address is used to send internal bug reports to. As an administrator, you want to include your email address here.
<!--T:56-->
<tvar name=PasswordSender>'''{{ll|Manual:$wgPasswordSender|$wgPasswordSender}}'''</tvar> is the email address where email gets sent ''from'', when passwords are sent out to users who have forgotten their passwords. Choose an address people can reply to in case of trouble or confusion.
===Database settings=== <!--T:57-->
<!--T:58-->
MediaWiki needs access to the database (currently either [[w:MySQL|MySQL]] or [[w:PostgreSQL|PostgreSQL]]) to store pages, modifications, user information, and a lot more things.
<!--T:59-->
<tvar name=DBserver>'''{{ll|Manual:$wgDBserver|$wgDBserver}}'''</tvar> contains the hostname where the database is hosted on. In most cases this will be just "localhost" as the database is run on the same system, but for distributed installations, you need to fill in the fully qualified domain name of the computer running the database.
<!--T:60-->
<tvar name=DBname>'''{{ll|Manual:$wgDBname|$wgDBname}}'''</tvar> is the ''database name'' of the database to be used by MediaWiki. A single MySQL or PostgreSQL installation can store more than one database and you can even run many MediaWiki installations on a single server. Make sure you have stated the correct database name here and use different database names for different wiki installations on the same database server.
<!--T:61-->
<tvar name=DBuser>'''{{ll|Manual:$wgDBuser|$wgDBuser}}'''</tvar> and <tvar name=DBpassword>'''{{ll|Manual:$wgDBpassword|$wgDBpassword}}'''</tvar> contain the login name and password to be used by MediaWiki to access the database. Make sure the specified user has the proper access rights to be able to manipulate the wiki's table on the database server.
</translate>
<translate><!--T:163--> Also see <tvar name="1">{{ll|Manual:Securing database passwords}}</tvar> for a method to move the sensitive parts of <tvar name="2"><code>LocalSettings.php</code></tvar> to a different file in a different directory.</translate>
<translate>
===User rights=== <!--T:62-->
<!--T:63-->
<tvar name=GroupPermissions>'''{{ll|Manual:$wgGroupPermissions|$wgGroupPermissions}}'''</tvar> is an associative array, controlling permissions for creating and editing pages for your different user groups. In this array, custom permission levels can be created, and permission levels for the different user groups can be set. See <tvar name=1>{{ll|Help:User rights}}</tvar> for more information about the different permissions and user groups available.
===Force capital links=== <!--T:64-->
<!--T:65-->
By default, no page name can start with a lowercase [[w:Latin alphabet|Roman letter]]: in an attempt to do so the first letter is converted to uppercase; if a link target, included page, image or category is specified with a name starting with a lowercase letter, the actual target etc. is the page starting with the corresponding capital.
<!--T:66-->
Alternatively page names ''can'' start with a lowercase letter, in addition to the possibilities of starting with a capital, a digit, etc. For that you must adjust <tvar name=CapitalLinks>'''{{ll|Manual:$wgCapitalLinks|$wgCapitalLinks}}'''</tvar>. Setting it to '''false''' allows lowercase characters, '''true''' chooses the default behavior.
===Enabling subpages=== <!--T:67-->
<!--T:68-->
In <tvar name="1"><code>LocalSettings.php</code></tvar>, [[<tvar name=subpg>Special:MyLanguage/Help:Subpages</tvar>|subpages]] are enabled on a per-namespace basis using <tvar name=NamespacesWithSubpages>'''{{ll|Manual:$wgNamespacesWithSubpages|$wgNamespacesWithSubpages}}'''</tvar>. For example, to enable subpages in the main namespace:
</translate>
<syntaxhighlight lang="php">
$wgNamespacesWithSubpages[NS_MAIN] = 1;
</syntaxhighlight>
<translate>
===Image uploads=== <!--T:69-->
<!--T:70-->
Before users are allowed to upload files to the MediaWiki system, you have to enable that feature. Make sure the Upload Directory is properly configured and writeable by the Apache web server process. Then set <tvar name=EnableUploads>'''{{ll|Manual:$wgEnableUploads|$wgEnableUploads}}'''</tvar> to '''true''' to allow uploading in the web user interface.
<!--T:71-->
i.e. Here's some example code from <tvar name=2><code>includes/DefaultSettings.php</code></tvar> to put in <tvar name="1"><code>LocalSettings.php</code></tvar>:
</translate>
<syntaxhighlight lang="php" style="overflow:auto;">
$wgUploadPath      = "$wgScriptPath/uploads";      ## <translate nowrap><!--T:171--> Wiki 1.5 defaults to <tvar name="1">/images</tvar>, but allows more than just images</translate>
$wgUploadDirectory  = "$IP/uploads";                ## <translate nowrap><!--T:172--> Wiki 1.5 defaults to <tvar name="1">/images</tvar>, but allows more than just images</translate>
## <translate nowrap><!--T:173--> To enable image uploads, make sure the above <tvar name="1">'$wgUploadPath'</tvar> directory is writable by Apache User or group.</translate>
## <translate nowrap><!--T:174--> ''(i.e.  <tvar name="1">chmod og+w uploads images</tvar>)''  then the following should be true:</translate>
$wgEnableUploads      = true;
$wgUseImageMagick      = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
## <translate nowrap><!--T:175--> If you want to use image uploads under safe mode, create the directories</translate>
## <translate nowrap><!--T:176--> <tvar name="1">images/archive</tvar>, <tvar name="2">images/thumb</tvar> and <tvar name="3">images/temp</tvar>, then configure them all writable. Afterwards, uncomment this, if it's not already done:</translate>
$wgHashedUploadDirectory = false;
</syntaxhighlight>
<translate><!--T:72--> If you want to be able to resize images on the fly to support thumbnails, MediaWiki needs a working [[w:ImageMagick|ImageMagick]] installation.</translate>
<translate><!--T:127--> Set <tvar name=1>'''{{ll|Manual:$wgUseImageMagick|$wgUseImageMagick}}'''</tvar> to '''true''' once you have installed and tested ImageMagick on your system.</translate>
<translate><!--T:128--> Make sure <tvar name=1>'''{{ll|Manual:$wgImageMagickConvertCommand|$wgImageMagickConvertCommand}}'''</tvar> points to the proper location of the <tvar name=2><code>convert</code></tvar> command of your installation, that the command is executable by the web server process, and <tvar name=3>'''{{ll|Manual:$wgMaxShellMemory|$wgMaxShellMemory}}'''</tvar> is large enough.</translate>
<translate><!--T:129--> See {{<tvar name=1>ll|Manual:Image administration#Image thumbnailing</tvar>|Manual:Image administration#Image thumbnailing}} for detailed information and troubleshooting.</translate>
<translate>
<!--T:73-->
Also, you may want to modify the list of accepted extensions, which is stored within <tvar name=1>'''{{ll|Manual:$wgFileExtensions|$wgFileExtensions}}'''</tvar>:
</translate>
<syntaxhighlight lang="php">
$wgFileExtensions = [ 'png', 'jpg', 'jpeg', 'ogg', 'doc', 'xls', 'ppt', 'mp3', 'sxc', 'pdf' ];
</syntaxhighlight>
<translate>
<!--T:74-->
In case ImageMagick outputs an error message similar to the following:
</translate>
<blockquote>
<translate><!--T:164--> Fatal error: mime_magic could not be initialised, magic file is not available in includes/MimeMagic.php on line 506</translate>
</blockquote>
<translate>
<!--T:75-->
then try adding the following line to <tvar name="1"><code>LocalSettings.php</code></tvar>:
</translate>
<code class="mw-code mw-highlight" style="display:block"><!--
-->{{ll|Manual:$wgMimeDetectorCommand|$wgMimeDetectorCommand}} = {{#tag:span|"file -bi"|class=s2}};
</code>
{{note|1=<translate><!--T:76--> Read the [[<tvar name=1>Special:MyLanguage/Manual:Security#Upload security</tvar>|upload security]] section in the [[<tvar name=1>Special:MyLanguage/Manual:Security#Upload security</tvar>|Manual:Security]].</translate><br />
<translate>
<!--T:109-->
Further information is available in:
</translate>
* {{ll|Manual:Configuring file uploads}}
* {{ll|Manual:MIME type detection}}
* {{ll|Manual:Image administration#Image thumbnailing|2=<translate><!--T:144--> Manual:Image administration#Image thumbnailing</translate>}}
<!-- should be synced or merged! -->
}}
<translate>
===Interwiki support=== <!--T:79-->
</translate>
<translate><!--T:80--> InterWiki support is built into MediaWiki but you need to configure the prefix to be used for your internal links.</translate>
<translate><!--T:118--> This prefix is usually the same as <tvar name=1>{{wg|Sitename}}</tvar>, but in case you need to change that, you set the <tvar name=2>{{wg|LocalInterwikis}}</tvar> variable to the preferred name.</translate>
<translate>
===Language of user interface=== <!--T:81-->
<!--T:82-->
MediaWiki allows for a variety of localised user interfaces languages instead of the English default. If you want to run your wiki in a non-English language, set the <tvar name=LanguageCode>{{wg|LanguageCode}}</tvar> variable to the proper [[<tvar name="1">Special:SiteMatrix</tvar>|language code]] (e.g. "de" for German, "es" for Spanish, etc.)
</translate>
<translate><!--T:83--> You may use any of the languages with a file in the directory <tvar name="1">{{git file |file=languages/i18n}}</tvar>.</translate>
<translate><!--T:180--> E.g. if you find <tvar name="2"><code>es.json</code></tvar>, then you can use <tvar name="3"><code>"es"</code></tvar> for Spanish.</translate>
<translate><!--T:181--> Do not use <tvar name="4"><code>"Es"</code></tvar> with a capital letter.</translate>
<translate><!--T:182--> Although it seems to work, not all texts are translated.</translate>
{{note|1=<translate><!--T:84--> After changing the language code, you will need to run a PHP script to make it work.</translate> <translate><!--T:113--> In a terminal window, change to your wiki directory, change to the <tvar name="1"><code>maintenance</code></tvar> folder, and enter <tvar name=2><code>php rebuildMessages.php --rebuild</code></tvar>.</translate> <translate><!--T:114--> On Windows, the PHP folder might not be in your <tvar name="1"><code>PATH</code></tvar> environment variable and you'll have to prefix <kbd>php</kbd> with the path to the program.</translate>}}
<translate><!--T:85--> Not all languages are supported.</translate>
<translate><!--T:166--> See the [<tvar name=url>https://translatewiki.net/w/i.php?title=Special:MessageGroupStats&group=mediawiki</tvar> translation statistics on TranslateWiki] for an up-to-date list of which languages are supported and to what extent.</translate>
<translate><!--T:167--> That list reflects the current state of MediaWiki core, so depending on what version you are using there may be a discrepancy.</translate>
<translate>
===Setting copyright for the site=== <!--T:86-->
<!--T:87-->
* <tvar name=RightsPage>'''{{ll|Manual:$wgRightsPage|$wgRightsPage}}'''</tvar> is the page on the wiki that covers the copyrights that it falls under. Usually, this will be <tvar name="1">{{ll|Project:Copyrights}}</tvar>.</translate>
<translate>
<!--T:141-->
* <tvar name=RightsUrl>'''{{ll|Manual:$wgRightsUrl|$wgRightsUrl}}'''</tvar> is the page describing full details of your license. (For the GNU FDL, for example, this would be <tvar name="1"><code>http://www.gnu.org/licenses/fdl.html</code></tvar>.) </translate>
<translate>
<!--T:142-->
* <tvar name=RightsText>'''{{ll|Manual:$wgRightsText|$wgRightsText}}'''</tvar> is the text in the footer that follows "Content is available under". It will be linked to the page specified in <tvar name="1"><code>$wgRightsPage</code></tvar>.</translate>
<translate>
<!--T:143-->
* <tvar name=RightsIcon>'''{{ll|Manual:$wgRightsIcon|$wgRightsIcon}}'''</tvar> is the URL of the image placed at the left of the footer.
</translate>
{{note|1=<translate><!--T:115--> If <tvar name="1"><code>$wgRightsPage</code></tvar> is non-empty, the link in the copyright/license notice will link to that page on your site.</translate> <translate><!--T:179--> If <tvar name=1><code>$wgRightsPage</code></tvar> is empty then the copyright/license notice will link to <tvar name="3"><code>$wgRightsUrl</code></tvar> instead.</translate>}}
<translate>
<!--T:88-->
To modify the copyright statements of the site, add something like this to <tvar name="1"><code>LocalSettings.php</code></tvar>:
</translate>
<syntaxhighlight lang="php" style="overflow:auto;">
$wgRightsPage = "YourWiki:Copyright";
$wgRightsText = "copyright YourWiki";
</syntaxhighlight>
<translate>
<!--T:89-->
Afterwards, edit <tvar name="2">[[MediaWiki:Copyright-footer]]</tvar> to provide an appropriate message, using <tvar name="1"><code>"$1"</code></tvar> to indicate the position where the link to your copyright page will be.
<!--T:90-->
'''Example: setting a [[w:Creative Commons|Creative Commons]] license'''
<!--T:91-->
To set a Creative Commons license do the following:
<!--T:92-->
* Choose your license: <tvar name=url>http://creativecommons.org/choose/</tvar></translate>
* <translate><!--T:165--> Examine the returned HTML code, e.g.:</translate>
<syntaxhighlight lang="html4strict" style="overflow:auto;">
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
<img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights30.png" />
</a>
This work is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License</a>.
</syntaxhighlight>
* <translate><!--T:93--> For <tvar name="1"><code>$wgRightsURL</code></tvar> enter the href info from the first anchor:</translate> <syntaxhighlight lang="php" style="overflow:auto;">
$wgRightsUrl = "http://creativecommons.org/licenses/by-nc-sa/3.0/";
</syntaxhighlight>
* <translate><!--T:94--> For <tvar name="1"><code>$wgRightsText</code></tvar> enter the text the second anchor links from (add the "a" to the Wiki variable for a more grammatically correct version)</translate> <syntaxhighlight lang="php" style="overflow:auto;">
$wgRightsText = "a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License";
</syntaxhighlight>
* <translate><!--T:95--> For <tvar name="1"><code>$wgRightsIcon</code></tvar> enter the src info from the img link in the first anchor. You want to copy the badge to your own site instead of using the one from the Creative Commons site.</translate> <syntaxhighlight lang="php" style="overflow:auto;">
$wgRightsIcon = "http://creativecommons.org/images/public/somerights30.png";
</syntaxhighlight>
<translate>
===Custom namespaces=== <!--T:97-->
</translate>
<translate><!--T:98--> By declaring <tvar name=1>'''{{ll|Manual:$wgExtraNamespaces|$wgExtraNamespaces}}'''</tvar>, and modifying <tvar name=2>'''{{ll|Manual:$wgNamespacesWithSubpages|$wgNamespacesWithSubpages}}'''</tvar>, and <tvar name=3>'''{{ll|Manual:$wgNamespacesToBeSearchedDefault|$wgNamespacesToBeSearchedDefault}}'''</tvar>, extra namespaces can be added to a MediaWiki installation; and by declaring the <tvar name=4>'''{{ll|Manual:$wgNamespaceAliases|$wgNamespaceAliases}}'''</tvar> array namespace aliases can be added.</translate>
<translate><!--T:119--> '''Take heed''' not to have any pages already titled in that namespace, for instance if you had a page called "Technical:Support" and you created the Technical: namespace, then that page would not only be lost, but you cannot remove it from Special:Allpages.</translate>
<translate><!--T:120--> To fix this delete the namespace, move "Technical:Support" to "Support" in mainspace, delete the redirect, reinsert the namespace, and move it back to "Technical:Support".</translate>
<translate><!--T:121--> See {{<tvar name=1>ll|Manual:Using custom namespaces</tvar>|Custom namespaces}} for more information as to how to do so.</translate>
<translate>
===Skins=== <!--T:99-->
<!--T:100-->
The default skin of the site can be modified via <tvar name=DefaultSkin>'''{{ll|Manual:$wgDefaultSkin|$wgDefaultSkin}}'''</tvar>.
==See also== <!--T:101-->
</translate>
* {{file doclink |LocalSettingsGenerator}} <translate><!--T:107--> source code, which generates the inital contents of <tvar name="1"><code>LocalSettings.php</code></tvar> during installation.</translate>
<translate>
<!--T:102-->
*[[<tvar name=wfamily>Special:MyLanguage/Manual:Wiki family</tvar>|Wiki families]] can share the same {{BASEPAGENAME}}.
</translate>
*{{ll|Manual:Securing database passwords}} - <translate><!--T:145--> a guide to securing your database passwords and <tvar name=1><code>LocalSettings.php</code></tvar> file.</translate>
[[Category:MediaWiki configuration{{#translation:}}| ]]

Version vom 10. August 2026, 23:29 Uhr

<languages/> Vorlage:BOMWarning Vorlage:MW file

<translate> The <tvar name=1>LocalSettings.php</tvar> file provides basic [[<tvar name=2>Special:MyLanguage/Manual:Configuration settings</tvar>|configuration settings]] of a <tvar name=5>Vorlage:Ll</tvar> installation.</translate> <translate> You should take your time to review the settings in this file.</translate> <translate> The file is usually generated by the web-based MediaWiki installer but you can tweak the parameters, possibly in concert with Apache settings.</translate> <translate> For MediaWiki installations configured as a [[<tvar name=2>Special:MyLanguage/Manual:Wiki family</tvar>|wiki farm]], a file named <tvar name=1>Vorlage:Ll</tvar> may be used.</translate>

<translate>

Location on the server

</translate> <translate> The <tvar name="1">LocalSettings.php</tvar> file is not a wiki page, and you cannot access it with your web browser.</translate> <translate> Instead, it is a file in the file system of the server.</translate> <translate> Its contents are generated during the initial setup of the wiki, and the resulting file must be copied to the server manually.</translate> <translate> The file must be located in the folder you installed MediaWiki into, on the same level with folders like <tvar name="1">includes/</tvar> and <tvar name="2">skins/</tvar> and files like <tvar name="3">api.php</tvar>.</translate> <translate> If this file is not there, the wiki will not work at all—if the wiki does work, the file is there.</translate> <translate> If you do not know where it is, you can enter a command such as <tvar name=1>find / -iname LocalSettings.php -print</tvar> in a terminal window to locate it.</translate>

<translate> (If you are using Vagrant, see also [[<tvar name=vagrant>Special:MyLanguage/MediaWiki-Vagrant#mw-settings</tvar>|MediaWiki-Vagrant#MediaWiki_settings]].)

Security

</translate> <translate> <tvar name="1">LocalSettings.php</tvar> usually contains sensitive data such as database logins.</translate> <translate> This data should never be revealed to the public!</translate> <translate> Due to a security breach somewhere on the server, it might happen that other users are able to view the contents of files.</translate> <translate> In order to improve security of your data, you should set UNIX permissions for this file accordingly: The webserver user must have access to this file.</translate> <translate> If this is the same account, who is the owner of the file, then you can set permissions to 600.</translate> <translate> Sometimes, the webserver user is not the file owner, but they are in the owner's UNIX user group.</translate> <translate> In this case, permissions of 640 should be fine. For improved security you should narrow permissions down as far as possible.</translate>

<translate> Additionally, you can create a MySQL user, who is restricted to only the database used by the wiki and provide this user's credentials in <tvar name="1">LocalSettings.php</tvar>. Also you can configure your database server to only accept connections from localhost - this should prevent access from outside in case of leaked credentials.

See also <tvar name=1>Vorlage:Ll</tvar> for a method to move the sensitive parts of <tvar name=2>LocalSettings.php</tvar> to a different file in a different directory.

File contents

When you edit <tvar name="1">LocalSettings.php</tvar>, make sure to save it in the right encoding again. You should use "ANSI as UTF-8" encoding - that is UTF-8 encoding without byte order mark (BOM).

<tvar name="1">LocalSettings.php</tvar> contains PHP code; mainly the definition of variables and their values. Changing a setting usually means changing the value of a PHP variable. Your changes will take effect immediately after saving the file again on the server: There is no need to manually "restart" anything, although in some cases you may need to clear your browser's cache to actually see the changes you made. </translate>

<translate> The default values of configuration settings are set in <tvar name="1">includes/MainConfigSchema.php</tvar>, which should not be edited; if the variable you want to change is not already mentioned in your <tvar name=2>LocalSettings.php</tvar>, add a line to that file and modify it appropriately.</translate> <translate> Within <tvar name=1>LocalSettings.php</tvar> you can add new lines at the end.</translate>

Vorlage:Tmpl <translate> These lines enable the corresponding extension in the wiki.</translate> <translate> Those extensions may require setting the values of more variables in <tvar name="1">LocalSettings.php</tvar>; check the documentation of the extension itself for further instructions.</translate>

<translate> Like most PHP files in MediaWiki, <tvar name="1">LocalSettings.php</tvar> does not end with the closing PHP tag <tvar name=code>Vorlage:Phpi</tvar>. This prevents admins from accidentally adding new information after this tag. PHP works fine without a closing tag.

If you have a wiki on a MediaWiki wiki farm you may not have write-access (perhaps not even read-access) to the file <tvar name="1">LocalSettings.php</tvar> (see e.g. <tvar name=wikiaforum>[1]</tvar>). The wiki farm company may or may not be willing to make changes you desire. Perhaps it wants to keep most settings the same on all wikis of the wiki farm. </translate>

Vorlage:Note

<translate>

Overview of available settings

See the [[<tvar name=config>Special:MyLanguage/Manual:Configuration settings</tvar>|configuration settings index]] and the comments included in the settings files for help on what all the variables do. A short listing of the most important variables, as well as the most requested features, is listed below.

Standard settings

Install path

</translate> <translate> The <tvar name=1>Vorlage:Ll</tvar> (install path) variable holds the local file path to the base installation of your wiki.</translate> <translate> Since MediaWiki 1.18, the system sets <tvar name=1>$IP</tvar> automatically.</translate> <translate> Setting <tvar name=1>Vorlage:Phpi</tvar> manually in <tvar name=2>LocalSettings.php</tvar> is no longer needed.</translate> <translate> <tvar name=1>Vorlage:Phpi</tvar> will default to the current working directory and can be used without the need to manually define it.</translate> <translate> Attempting to set <tvar name="1">Vorlage:Phpi</tvar> (or <tvar name="2">MW_INSTALL_PATH</tvar>) in <tvar name="3">LocalSettings.php</tvar> may produce unexpected results.</translate>

<translate>

Site name

<tvar name=1>Vorlage:Ll</tvar> holds the name of your wiki setup. This name gets included many times throughout the system, such as via MediaWiki:Pagetitle. For instance, the Wikipedia tagline "From Wikipedia, the free encyclopedia" makes use of this setting.

Declensions of site name

</translate> <translate> Some translations of interface are ready for inflection of site name.</translate> <translate> You can set proper forms of word in variables <tvar name=1>Vorlage:Ll</tvar> (for example please refer to the <tvar name=2>Vorlage:Ll</tvar> documentation page).</translate>

<translate>

Script path

</translate> <translate> <tvar name=1>Vorlage:Ll</tvar> is the URL path prefix to access the main MediaWiki script that is the central acting piece of code of MediaWiki.</translate> <translate> This setting should correspond to the [[<tvar name=1>Special:MyLanguage/Apache configuration</tvar>|Apache settings]], especially if you are using Apache's rewrite rules.</translate>

<translate>

Server name

<tvar name=Server>Vorlage:Ll</tvar> contains the base URL of the server, including protocol but without the trailing slash and without the subdirectory if any. When the wiki is accessed from either the localhost where it runs, from an intranet or from the internet, email notifications and a few other computed messages would be usually delivered with the different URLs. </translate>

<translate> From MediaWiki 1.34 <tvar name=1>Vorlage:Phpi</tvar> must be set in <tvar name=2>LocalSettings.php</tvar>.</translate> <translate> Prior to that, MediaWiki tried to autodetect the name of the server and <tvar name=1>Vorlage:Phpi</tvar> was optional, to override the autodetection.</translate>

<translate> If www.example.com is the server address of your wiki as seen from the internet, add a line such as </translate>

$wgServer = 'http://www.example.com';

<translate> The [[<tvar name=1>Special:MyLanguage/Help:Magic words#Page names and related info</tvar>|magic word]] variable <tvar name=2>{{SERVER}}</tvar> can be used on wiki pages; it equals the value of <tvar name=3>Vorlage:Phpi</tvar>; however, on a wiki, such as those in the Wikimedia family, where relative urls are used, it will not fully expand, for example here it displays <tvar name=4>https://wiki.foxtom.de</tvar>, which can neither be clicked nor copy-pasted into the address bar as it is. </translate>

<translate> You can also use a protocol relative URL as shown below.</translate> <translate> When using a protocol relative URL, be sure to set <tvar name="1">Vorlage:Phpi</tvar>.</translate> <translate> <tvar name="1">Vorlage:Phpi</tvar> is needed for some places in the code where an origin with a protocol and hostname is needed.</translate>

$wgServer = '//www.example.com';
$wgCanonicalServer = 'https://www.example.com';

<translate>

Script name

<tvar name=Script>Vorlage:Ll</tvar> is the name of the main (index) MediaWiki PHP script, named <tvar name="1">index.php</tvar> by default. Changing the script name is probably not a good idea. However, if you feel the urge to do so, this is the place to make your changes. Make sure you know what you are doing.

Article path

</translate> <translate> <tvar name=ArticlePath>Vorlage:Ll</tvar> is the path to use when accessing a page in MediaWiki.</translate> <translate> The path should contain the path to the main script (usually making use of <tvar name=1>Vorlage:Phpi</tvar>) and use the <tvar name=2>$1</tvar> placeholder for the article name.</translate>

<translate> If you are using Apache rewrite rules to create pretty and short URLs, you probably need to adjust <tvar name=1>Vorlage:Phpi</tvar> to address the right path.</translate> <translate> Note that <tvar name=1>wgArticlePath</tvar> is used to construct URLs from within MediaWiki.</translate> <translate> If you make a mistake here, internal links will show up incorrectly while you still may be able to access the main page by specifying the correct URL manually.</translate> <translate> See <tvar name=1>Vorlage:Ll</tvar> for more information on URL configuration.</translate>

<translate> Typical values are: </translate>

"$wgScript/$1" <translate> pass the article name with separator "/"</translate>
"$wgScript?title=$1" <translate> pass the article name as a parameter (old style)</translate>
"/mypath/$1" <translate> custom path. Use Apache rewrite rules to convert "mypath" to the proper path accessing the main script</translate>

<translate>

Stylesheet location

</translate> <translate> Use <tvar name=1>Vorlage:Ll</tvar> to set the URL path to the place where the stylesheets (CSS) for the MediaWiki installation are located.</translate> <translate> <tvar name=1>Vorlage:Ll</tvar> should point the same place, but note that this is a local file system path for use in internal scripts accessing the file system.</translate>

<translate>

Upload location

The upload directory is the place where files uploaded by the users are stored. <tvar name=1>Vorlage:Ll</tvar> specifies the URL path, <tvar name=2>Vorlage:Ll</tvar> points to the local file system path.

<tvar name=Logo>Vorlage:Ll</tvar> specifies which graphical logos are displayed in the top left corner of the page in most MediaWiki installations.

See <tvar name="1">Vorlage:Ll</tvar> for how to change the logo.

Contact info

<tvar name=EmergencyContact>Vorlage:Ll</tvar> is the email address of the user to contact if something goes wrong. This email address is used to send internal bug reports to. As an administrator, you want to include your email address here.

<tvar name=PasswordSender>Vorlage:Ll</tvar> is the email address where email gets sent from, when passwords are sent out to users who have forgotten their passwords. Choose an address people can reply to in case of trouble or confusion.

Database settings

MediaWiki needs access to the database (currently either MySQL or PostgreSQL) to store pages, modifications, user information, and a lot more things.

<tvar name=DBserver>Vorlage:Ll</tvar> contains the hostname where the database is hosted on. In most cases this will be just "localhost" as the database is run on the same system, but for distributed installations, you need to fill in the fully qualified domain name of the computer running the database.

<tvar name=DBname>Vorlage:Ll</tvar> is the database name of the database to be used by MediaWiki. A single MySQL or PostgreSQL installation can store more than one database and you can even run many MediaWiki installations on a single server. Make sure you have stated the correct database name here and use different database names for different wiki installations on the same database server.

<tvar name=DBuser>Vorlage:Ll</tvar> and <tvar name=DBpassword>Vorlage:Ll</tvar> contain the login name and password to be used by MediaWiki to access the database. Make sure the specified user has the proper access rights to be able to manipulate the wiki's table on the database server. </translate>

<translate> Also see <tvar name="1">Vorlage:Ll</tvar> for a method to move the sensitive parts of <tvar name="2">LocalSettings.php</tvar> to a different file in a different directory.</translate>

<translate>

User rights

<tvar name=GroupPermissions>Vorlage:Ll</tvar> is an associative array, controlling permissions for creating and editing pages for your different user groups. In this array, custom permission levels can be created, and permission levels for the different user groups can be set. See <tvar name=1>Vorlage:Ll</tvar> for more information about the different permissions and user groups available.

By default, no page name can start with a lowercase Roman letter: in an attempt to do so the first letter is converted to uppercase; if a link target, included page, image or category is specified with a name starting with a lowercase letter, the actual target etc. is the page starting with the corresponding capital.

Alternatively page names can start with a lowercase letter, in addition to the possibilities of starting with a capital, a digit, etc. For that you must adjust <tvar name=CapitalLinks>Vorlage:Ll</tvar>. Setting it to false allows lowercase characters, true chooses the default behavior.

Enabling subpages

In <tvar name="1">LocalSettings.php</tvar>, [[<tvar name=subpg>Special:MyLanguage/Help:Subpages</tvar>|subpages]] are enabled on a per-namespace basis using <tvar name=NamespacesWithSubpages>Vorlage:Ll</tvar>. For example, to enable subpages in the main namespace: </translate>

$wgNamespacesWithSubpages[NS_MAIN] = 1;

<translate>

Image uploads

Before users are allowed to upload files to the MediaWiki system, you have to enable that feature. Make sure the Upload Directory is properly configured and writeable by the Apache web server process. Then set <tvar name=EnableUploads>Vorlage:Ll</tvar> to true to allow uploading in the web user interface.

i.e. Here's some example code from <tvar name=2>includes/DefaultSettings.php</tvar> to put in <tvar name="1">LocalSettings.php</tvar>: </translate>

$wgUploadPath       = "$wgScriptPath/uploads";      ## <translate nowrap><!--T:171--> Wiki 1.5 defaults to <tvar name="1">/images</tvar>, but allows more than just images</translate>
$wgUploadDirectory  = "$IP/uploads";                ## <translate nowrap><!--T:172--> Wiki 1.5 defaults to <tvar name="1">/images</tvar>, but allows more than just images</translate>

## <translate nowrap><!--T:173--> To enable image uploads, make sure the above <tvar name="1">'$wgUploadPath'</tvar> directory is writable by Apache User or group.</translate>
## <translate nowrap><!--T:174--> ''(i.e.  <tvar name="1">chmod og+w uploads images</tvar>)''  then the following should be true:</translate>
$wgEnableUploads       = true;

$wgUseImageMagick      = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

## <translate nowrap><!--T:175--> If you want to use image uploads under safe mode, create the directories</translate>
## <translate nowrap><!--T:176--> <tvar name="1">images/archive</tvar>, <tvar name="2">images/thumb</tvar> and <tvar name="3">images/temp</tvar>, then configure them all writable. Afterwards, uncomment this, if it's not already done:</translate>
$wgHashedUploadDirectory = false;

<translate> If you want to be able to resize images on the fly to support thumbnails, MediaWiki needs a working ImageMagick installation.</translate> <translate> Set <tvar name=1>Vorlage:Ll</tvar> to true once you have installed and tested ImageMagick on your system.</translate> <translate> Make sure <tvar name=1>Vorlage:Ll</tvar> points to the proper location of the <tvar name=2>convert</tvar> command of your installation, that the command is executable by the web server process, and <tvar name=3>Vorlage:Ll</tvar> is large enough.</translate> <translate> See {{<tvar name=1>ll|Manual:Image administration#Image thumbnailing</tvar>|Manual:Image administration#Image thumbnailing}} for detailed information and troubleshooting.</translate>

<translate> Also, you may want to modify the list of accepted extensions, which is stored within <tvar name=1>Vorlage:Ll</tvar>: </translate>

$wgFileExtensions = [ 'png', 'jpg', 'jpeg', 'ogg', 'doc', 'xls', 'ppt', 'mp3', 'sxc', 'pdf' ];

<translate> In case ImageMagick outputs an error message similar to the following: </translate>

<translate> Fatal error: mime_magic could not be initialised, magic file is not available in includes/MimeMagic.php on line 506</translate>

<translate> then try adding the following line to <tvar name="1">LocalSettings.php</tvar>: </translate>

Vorlage:Ll = "file -bi";

Vorlage:Note

<translate>

Interwiki support

</translate> <translate> InterWiki support is built into MediaWiki but you need to configure the prefix to be used for your internal links.</translate> <translate> This prefix is usually the same as <tvar name=1>Vorlage:Wg</tvar>, but in case you need to change that, you set the <tvar name=2>Vorlage:Wg</tvar> variable to the preferred name.</translate>

<translate>

Language of user interface

MediaWiki allows for a variety of localised user interfaces languages instead of the English default. If you want to run your wiki in a non-English language, set the <tvar name=LanguageCode>Vorlage:Wg</tvar> variable to the proper [[<tvar name="1">Special:SiteMatrix</tvar>|language code]] (e.g. "de" for German, "es" for Spanish, etc.) </translate>

<translate> You may use any of the languages with a file in the directory <tvar name="1">Vorlage:Git file</tvar>.</translate> <translate> E.g. if you find <tvar name="2">es.json</tvar>, then you can use <tvar name="3">"es"</tvar> for Spanish.</translate> <translate> Do not use <tvar name="4">"Es"</tvar> with a capital letter.</translate> <translate> Although it seems to work, not all texts are translated.</translate>

Vorlage:Note

<translate> Not all languages are supported.</translate> <translate> See the [<tvar name=url>https://translatewiki.net/w/i.php?title=Special:MessageGroupStats&group=mediawiki</tvar> translation statistics on TranslateWiki] for an up-to-date list of which languages are supported and to what extent.</translate> <translate> That list reflects the current state of MediaWiki core, so depending on what version you are using there may be a discrepancy.</translate>

<translate>

  • <tvar name=RightsPage>Vorlage:Ll</tvar> is the page on the wiki that covers the copyrights that it falls under. Usually, this will be <tvar name="1">Vorlage:Ll</tvar>.</translate>

<translate>

<translate>

  • <tvar name=RightsText>Vorlage:Ll</tvar> is the text in the footer that follows "Content is available under". It will be linked to the page specified in <tvar name="1">$wgRightsPage</tvar>.</translate>

<translate>

  • <tvar name=RightsIcon>Vorlage:Ll</tvar> is the URL of the image placed at the left of the footer.

</translate>

Vorlage:Note

<translate> To modify the copyright statements of the site, add something like this to <tvar name="1">LocalSettings.php</tvar>: </translate>

$wgRightsPage = "YourWiki:Copyright";
$wgRightsText = "copyright YourWiki";

<translate> Afterwards, edit <tvar name="2">MediaWiki:Copyright-footer</tvar> to provide an appropriate message, using <tvar name="1">"$1"</tvar> to indicate the position where the link to your copyright page will be.

Example: setting a Creative Commons license

To set a Creative Commons license do the following:

<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
<img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights30.png" />
</a>
This work is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License</a>.
  • <translate> For <tvar name="1">$wgRightsURL</tvar> enter the href info from the first anchor:</translate>
    $wgRightsUrl = "http://creativecommons.org/licenses/by-nc-sa/3.0/";
    
  • <translate> For <tvar name="1">$wgRightsText</tvar> enter the text the second anchor links from (add the "a" to the Wiki variable for a more grammatically correct version)</translate>
    $wgRightsText = "a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License";
    
  • <translate> For <tvar name="1">$wgRightsIcon</tvar> enter the src info from the img link in the first anchor. You want to copy the badge to your own site instead of using the one from the Creative Commons site.</translate>
    $wgRightsIcon = "http://creativecommons.org/images/public/somerights30.png";
    

<translate>

Custom namespaces

</translate> <translate> By declaring <tvar name=1>Vorlage:Ll</tvar>, and modifying <tvar name=2>Vorlage:Ll</tvar>, and <tvar name=3>Vorlage:Ll</tvar>, extra namespaces can be added to a MediaWiki installation; and by declaring the <tvar name=4>Vorlage:Ll</tvar> array namespace aliases can be added.</translate> <translate> Take heed not to have any pages already titled in that namespace, for instance if you had a page called "Technical:Support" and you created the Technical: namespace, then that page would not only be lost, but you cannot remove it from Special:Allpages.</translate> <translate> To fix this delete the namespace, move "Technical:Support" to "Support" in mainspace, delete the redirect, reinsert the namespace, and move it back to "Technical:Support".</translate> <translate> See {{<tvar name=1>ll|Manual:Using custom namespaces</tvar>|Custom namespaces}} for more information as to how to do so.</translate>

<translate>

Skins

The default skin of the site can be modified via <tvar name=DefaultSkin>Vorlage:Ll</tvar>.

See also

</translate>

  • Vorlage:File doclink <translate> source code, which generates the inital contents of <tvar name="1">LocalSettings.php</tvar> during installation.</translate>

<translate>

  • [[<tvar name=wfamily>Special:MyLanguage/Manual:Wiki family</tvar>|Wiki families]] can share the same LocalSettings.php.

</translate>

  • Vorlage:Ll - <translate> a guide to securing your database passwords and <tvar name=1>LocalSettings.php</tvar> file.</translate>

[[Category:MediaWiki configuration{{#translation:}}| ]]