Manual:FAQ/zh

我应该从哪里下载MediaWiki？
点击这里下载MediaWiki的最新稳定发行版. 我们会将文件存放在一个.tar.gz压缩包中. 您还可以从我们的Subversion直接获取最新版本.

我应该怎样安装MediaWiki？
MediaWiki的安装可能需要花费您10到30分钟的时间，其中包括上传／复制文件到服务器，并运行安装脚本配置软件——参见安装.

您可以在分发包的INSTALL文件中找到详细的安装指南.

我如何打包安装MediaWiki？
大部分Linux发行版都会以分发包的格式提供MediaWiki软件. MediaWiki开发团队认为您应该向您的Linux发行版提供者咨询安装与配置的事宜. 负责维护这些分发包的独立社群和公司应该向您提供安装指南.

我能在一台服务器上安装多个MediaWiki吗？
只要满足下列条件，您就可以在一台服务器上安装多个wiki：

或者
 * 您的每一个wiki使用各自不同的数据库
 * 您的每一个wiki的数据库前缀不相同（如果您用的是PostgreSQL，在不同的模式或用户下，也能达到这一效果）

要了解这些选项的相关信息，可分别参见$wgDBname与$wgDBprefix.

要了解设置wiki家族的相关信息，可参见Manual:Wiki家族.

要了解将多个wiki设置为使用相同服务器、数据库与资源的其他方法，参见来自Steve Rumberg（存档）用户的更深层的解释与进一步的意见.

MediaWiki可以工作在安全模式下吗？
可以，但其功能会受到一定限制. 参见安全模式.

MediaWiki需要终端访问吗？
终端访问（SSH访问）在安装MediaWiki的过程中并不是必须的，但我们强烈推荐你这么做. 如果不能进行终端访问，您可能难以对您的wiki进行备份，或难以将它升级到更新的版本. 如果完全脱离终端访问，您将不能完成一些维护任务.

我应该怎样安装插件？
参见Manual:Extensions获取安装插件与编写插件的相关信息. 参见插件矩阵与Category:插件以寻找已有的插件.

我如何才能增加额外的名字空间？
要增加名字空间，请修改您的LocalSettings.php文件，并通过$wgExtraNamespaces变量来增加名字空间. 您可以将下列代码加到上述文件中以增加“Portal”名字空间及其对应的讨论名字空间：


 * $wgExtraNamespaces = array(100 => "Portal", 101 => "Portal_talk");

请使用下划线来替代空格，例如Portal_talk. 否则，名字空间将不能被正确地定义！

我应该怎样启用上传功能？
文件上传是MediaWiki常用的功能之一，但在目前所有的发行版中都被默认关闭了. 要启用它们，首先要让网站服务器上的上传文件夹（默认为images）可被写入（chmod 777或允许Apache用户写入内容，等等），然后在LocalSettings.php中将$wgEnableUploads设为true值（例如“$wgEnableUploads = true;”）. 参见Manual:配置文件上传获取进一步的信息.

我如何才能插入数学公式？
在texvc软件的协助下，MediaWiki允许用户插入数学公式. texvc使用LaTeX来描述数学公式. 参见Manual:Math获取安装指南.

我怎样才能刷新被缓存的页面？
有时您需要刷新被缓存的页面，比如当页面的导航栏发生了变化后. 在页面的动态URL后加上 即可.

例如：http://www.mediawiki.org/w/index.php?title=Main_Page&action=purge

或在页面的短型URL后加上 ：

例如：http://www.mediawiki.org/wiki/Main_Page?action=purge

参见：Manual:刷新缓存、Manual:传给index.php的参数

我如何才能上传其他格式的文件？
您可以使用$wgFileExtensions来为MediaWiki配置允许上传的文件类型. 通常而言，相关的配置会在您MediaWiki安装根目录下的LocalSettings.php文件中找到.

例如，要允许用户上传PDF文件，将下列语句加入LocalSettings.php即可：

如果要允许用户上传多种类型的文件，语法会有所不同. 要实现这种需求，请仿造下方使用数组来允许png、gif、jpg、jpeg、pdf与txt文件上传的做法.

参见Manual:配置文件上传获取进一步的信息.

“文件已损坏或存在无效扩展名”
有些用户报告说，在向已允许扩展名列表中增加文件格式后，软件会发生错误. 出错后的文字类似于下方：


 * 文件已损坏或存在无效扩展名. 请重新检查并上传文件. 

可能的解决方案：


 * 设定$wgMimeDetectorCommand的值，例如：在Unix或Linux，您可以将它设为
 * $wgMimeDetectorCommand = "file --brief --mime";
 * 编译／安装PHP插件fileinfo
 * Fedora - yum install php-pecl-Fileinfo

参见Manual:Mime类型探测获取进一步的信息.

初始用户并未由安装者创建
有时，安装者有可能不能成功地创建默认用户，或者用户表因为某种原因丢失了. 有两种解决此问题的方案：

maintenance/createAndPromote.php

 * 确保已正确设定AdminSettings.php（参见AdminSettings.sample）
 * 在终端运行maintenance/createAndPromote.php</tt>

这样会创建一名新的用户，并将其提升为管理者. 要获取帮助信息，可在运行脚本时加上参数--help</tt>.

修改数据库
上方的 应被修改为您先前在参数设置中查到的用户ID.
 * 使用正规手段注册一个新帐户（Special:Userlogin）.
 * 在Special:参数设置中查出用户ID.
 * 在数据库运行以下SQL查询：
 * MediaWiki 1.5及更高版本：
 * MediaWiki 1.4：
 * MediaWiki 1.3及更低版本：

我如何才能重置密码？
您可以使用maintenance/changePassword.php</tt>维护脚本来重置一名用户的密码.

'''您必须在命令行下运行该脚本. '''换句话说，请登录到安装wiki的服务器，然后进入命令行提示符. 进入安装目录，然后进入maintenance子目录. 运行下列命令：

php changePassword.php --user=someuser --password=somepass

这里可见的“somepass”就是您将要设置的密码，而“someuser”就是您将修改其密码的用户名，该用户名应出现在数据库的“user”表中.

您同样可以使用直接修改数据库的老办法. 假设变量 $wgPasswordSalt 已被设为true值（默认），您可以在MySQL中运行下列SQL查询：

这里可见的“somepass”就是您将要设置的密码，而“someuser”就是您将修改其密码的用户名，该用户名应出现在数据库的“user”表中.

CONCAT字符串中的user_id</tt>是一项列名，不应被替换为'someuser'.

如果您得到了'dbname.user table does not exist'错误，请检查LocalSettings.php文件，并特别注意$wgDBprefix变量的值. 如果该变量不为空，请尝试重复执行上述命令，并将SQL查询UPDATE</tt>子句中的user</tt>替换为$wgDBPrefix_user</tt>.

如果您使用的是PostGreSQL，请使用下列查询替代：

您还可以尝试使用重设密码插件.

数据库专家需要的答案
如果您所感兴趣的外部链接链向维基百科，而您希望使用前缀“wp”来链向它（前缀“wikipedia”是链向Wikipedia的默认跨wiki前缀，参见Help:跨wiki链接获取其他默认前缀），运行下列SQL查询来在您的数据库中修改interwiki表： $1代表外部wiki中的条目名称.

一般用户需要的答案
在图形化的SQL程序中（例如PhpMyAdmin），进入interwiki表. 选好要插入的那一列，在iw_prefix项中，填入你想要的跨wiki前缀；在iw_url项中，填入外部wiki的基本URL并加上“$1”，$1的含义已在上方数据库专家答案中解释过. iw_local与iw_trans则均为默认值零（0）. 您将它们留为0即可.

更多相关的信息，参见Help:跨wiki链接

简单答案
安装Special:Interwiki插件. 然后您就可以通过Special:Interwiki特殊页面来添加或移除跨wiki入口了.

我怎样才能让我的基本URL更短？（例如：是“/wiki/条目名”而不是“/w/index.php?title=条目名”）
参见Manual:短URL.

MediaWiki.org上所有的内容都是自由下载和使用的吗？
是的，在自由软件意义下的自由. 参见Project:Copyrights了解本站已有内容在许可协议方面的问题.

我如何管理用户权限？
<span id="How_do_I_administrate.2Fmanage_my_users.3F"> 参见Manual:用户权限与Manual:用户权限管理获取常见的信息. 参见Manual:访问控制获取限制访问的方法与措施.

我怎样才能禁止匿名用户编写任何页面？
参见Manual:访问控制#限制匿名编辑获取进一步的信息.
 * 在LocalSettings.php底部加入 $wgGroupPermissions['*']['edit'] = false; 语句.

我怎样才能禁止匿名用户阅读任何页面？
参见Manual:$wgWhitelistRead. 参见Manual:访问控制#限制对所有页面的查看获取进一步的信息.
 * 在LocalSettings.php底部加入 $wgGroupPermissions['*']['read'] = false; 语句

我怎样才能限制帐户的创建？
参加Manual:访问控制#限制帐户创建获取进一步的信息.
 * 在LocalSettings.php底部加入 $wgGroupPermissions['*']['createaccount'] = false; 语句

升级
常用的升级过程说明都能在UPGRADE</tt>文件中找到. 参见Manual:升级.

升级有多难？
如果您只曾修改过LocalSettings.php文件，而且您是从1.5或更新的版本升级的，那么升级的过程将会非常简单. 需要人类插手的工作总共只有几分钟. 数据库模式修改的时间将根据您数据库的大小而定——如果是一个拥有百万页面的wiki，那么可能会花费几个小时，但如果只有几千个页面，那么通常几秒钟就完成了.

在同一个主要版本中的小升级，例如从1.13.0到1.13.1，不需要对数据库作出任何修改. 您只需要升级文件就行了.

如果您是从1.4或更早的版本升级的话，那么升级过程可能会有一些复杂，因为新版本不再支持UTF-8以外的字符集，存放大量字符的数据库会面临潜在的大量修改. 请阅读UPGRADE</tt>文件的相关段落获取有关信息.

如果您曾经动过我们的源文件，而且您不愿意让您的修改被覆盖的话，那么升级将变得有些困难. 类似diff和patch这样的工具会很有用. 还有一种潜在的问题在于您没有维护您使用的插件. 请在升级MediaWiki的同时也升级您的插件.

我如何才能从旧版本升级？一步还是逐步？
一步就可完成，直接将您的旧版本升级为最新的稳定版. 大量的报告以及自动测试指出，您一步就可以完成升级.

如果您不相信这个定论，请阅读此邮件列表的帖子.

我应该备份吗？
简短的回答：应该.

冗长的回答：这取决于a)你是否重视你的数据，b)创建备份的困难程度以及c)您对MySQL维护与管理的自信程度.

升级失败可能导致您的数据库陷入同时存在两个版本的不一致状态. 有可能发生在将某个重要的数据表移动到临时名称后，但在正确重建数据表前失败. 也有可能是将某一列修改为错误的数据类型. 因升级而造成的不可恢复的数据遗失非常罕见. 通常说来，一名有经验的管理员可以恢复被损坏的数据.

恢复过程通常会十分复杂. 如果你漏做了备份，却又跑到支持论坛上寻求帮助以修复因升级造成的损坏，支持论坛上的志愿者们往往就不会对你有什么好感. 更好的做法是你应尽量恢复到先前的备份，然后向我们报告在升级过程中造成损坏的bug.

我能保留我的LocalSettings.php吗？
可以，但你可能需要作出一些小的修改. LocalSettings.php的格式大致上是向下兼容的. 会影响LocalSettings.php兼容性的修改都会在发行日志（RELEASENOTES）的“configuration changes”一节中找到.

在我升级时我的wiki都能保持在线吗？
可以.

如果你是在小版本间升级，你只需要升级源文件.

如果你是在大版本间升级，以下是建议流程：

1. 将新版的MediaWiki解包到一个新的目录下 2. 在新目录中将LocalSettings.php配置正确，并将所有所需的插件都安装好. 3. 在旧目录的LocalSettings.php中配置只读模式

$wgReadOnly = '正在升级到MediaWiki ';

4. 在新目录中运行升级脚本. 5. 将旧目录切换为新目录.

我应该怎样修改logo？
出现在每一页左上方的logo是在LocalSettings.php文件中配置$wgLogo变量实现的.

有两种方法来修改logo：

使用你的wiki上传一幅图像并使用它的地址. 这样会使得图像的替代变得非常简单，因此如果您要使用这一办法，请保护该图像的页面.

然后在LocalSettings.php中增加$wgLogo一行，例如：

$wgLogo = 'http://yourwiki.org/wiki/images/6/62/photoname.jpg';

或者通过其他途径（如FTP）将图像上传到服务器上，然后在LocalSettings.php中增加$wgLogo一行，例如：

$wgLogo = "{$wgScriptPath}/photoname.jpg";

在上面的例子中，图像是与LocalSettings.php文件处于同一目录下的.

将这一行放在LocalSettings.php的末尾通常是较好的做法，特别是当你为$wgStylePath或$wgUploadPath指定参数后.

请勿只覆盖MediaWiki安装后的默认logo（ ）；这样在你升级后改文件会被改回.

''提示：logo图像的大小应为135 x 135像素. ''

我能定制左上角的logo吗？应该怎样做？
logo位于pBody部分外的portlet块中. 可以通过p-logo id来识别出. 背景图像是由wgLogo变量指定的，该变量定义于/includes/DefaultSettings.php中. 它的地址相对于网页服务器的根目录，而非系统根目录. 在/LocalSettings.php重定义该变量即可改变图像. 如果设置有错，页面将不会出现图像；检查您的网页服务器错误日志，并作出相应的调整. 同时，如果logo没有进行修剪，就应亦应确保p-logo的大小能足以乘放它. 这需要在样式表中对p-logo样式进行设置（monobook下的Main.css），其默认设置见下：

我如何定制左上角的logo链接，当我点击它时我想前往别的页面？
默认设置上，点击logo后会前往首页. 如果您希望修改首页的名称，编辑MediaWiki:Mainpage即可. 如果想要该链接链向任何URL，在Monobook皮肤下，编辑Monobook.php，找到 ，将之替换为你所需的URL地址，并将 替换为你所要显示的链接说明.

链向根目录的例子：替换 为

Reducing the size of the logo
Note that a tag is on top of the logo so if you are trying to reduce the size of the logo's portlet you will also need to change the #p-logo a and #p-logo a:hover rules. The default setting for these is:

This simple customization will re-define the size of all of them at once... There is one more rule controlling the amount of space between the logo and first portlet in the side column - the padding on the top of #column-one. By default this is: If you want to remove the logo completely, comment out the wgLogo variable. Then set the column-one padding to a small value, such as 21:

You shouldn't edit the CSS file directly. You need go to <Your Wiki URL>?title=MediaWiki:Monobook.css. Hit edit and make your changes there. The content of MediaWiki:Monobook.css page always overrides the default main.css file's contents.

How do I change the icon in the browser's address line (favicon)?

 * Simply upload your favicon.ico to the root of your domain/subdomain, make sure file name is in lower case and its name is favicon.ico
 * Alternatively edit the $wgFavicon setting in LocalSettings.php and add $wgFavicon = "$wgScriptPath/path/to/your/favicon.ico";</tt>

See Manual:$wgFavicon for more details.

Tip: The favicon image should be either 16 x 16 pixels or 32 x 32 pixels.

Rewrite Rule
If you are using a rewrite rule in .htaccess to remove "index.php" from the URL, you will also need to add an exception for .ico files. Simply add the following rule to your .htaccess:


 * RewriteRule .*\.ico$ - [L]

This rule must appear before the index.php rule.

大小写
因为许多服务器（例如运行在类UNIX操作系统上的）只能查找小写的文件名，所以请确保上传图标文件的文件名是小写的. 也就是说，原文件名为“Favicon.ico"的图标文件，在上传时应将文件名改为"favicon.ico".

我怎么定制导航条?
使用Monobook皮肤的每一个页面左边是导航条，其内容由您的wiki上的MediaWiki:Sidebar 页面决定. 定制这些内容的相关信息，请参看Manual:Navigation bar.

我怎样在每个页面上放置文本消息（站点通知）?
在MediaWiki:Sitenotice页面上放置文本. 它将会在每篇文章页面的顶部显示.

How do I change which page is the main page?
By default, MediaWiki looks for a page with the title Main Page and serves this as the default page. This can be changed by altering the contents of MediaWiki:Mainpage to point to a different title. If this does not change the 'Main Page' link included on the sidebar at install time, edit MediaWiki:Sidebar.

How do I hide the main page title?
MediaWiki does not have a built-in option to hide the main page title (see bug 6129). Instead you must use JavaScript or CSS.

MediaWiki version before 1.9, solution to hide the main page title
Before MediaWiki 1.9, you have two options:

Apply the patch
You can manually apply the patch from r17119 to your copy of MediaWiki and use the solution for 1.9.

FIRST replace or add the lines in three files in the correct place as r17119 did:
 * skins/monobook/Skin.php, add:


 * includes/SkinTemplate.php, add:


 * includes/MonoBook.php replace:
 * with:
 * with:

SECOND follow the instructions in.

JavaScript solution
The following JavaScript may or may not work for your wiki (replace "Main Page" with the name of your main page if it differs). Add the code to your wiki's MediaWiki:Common.js or MediaWiki:Monobook.js (Monobook.js for older wikis, Common.js for newer wikis):

Mediawiki version 1.9+, solution to hide the main page title
In 1.9 and above (or with the modified files above), you can use CSS to hide the main page title.

Add the following to the MediaWiki:Monobook.css (if you're using Monobook; otherwise add this to MediaWiki:Common.css to have it applied to all skins) on your wiki:

Alternatively, you can replace "Main_Page" with another name, but with spaces replaced by underscores _.

Troubleshooting
If this doesn't work, look at the HTML source code to find the correct class to replace "page-Main_Page" with:

If no such class exists, then you cannot use this feature. You may be using a custom or outdated skin.

Another option is to #REDIRECT from Main_Page to Our_Main_Page.

See also Main Page alternatives.

How can I hide the table of contents?
The table of contents (TOC) is automatically shown once there are four or more headings in the article. The are multiple ways to hide it.


 * For one page
 * Place the magic word  </tt> into the page markup.


 * For all pages
 * Add the following rule to MediaWiki:Common.css:  However, this is not the best solution, because the table of contents will be hidden even in those pages in which we want it to be displayed, by using the magic words   </tt> or   </tt>. A simpler and more efficient alternative is to edit the file /includes/parser/Parser.php, altering in line 3427 the limit of 4 headings:   to a higher value (e.g. 10). This way the table of contents will only be displayed in pages with 10 or more headings, OR in pages which contain one of the magic words   </tt> or   </tt>.


 * Per user
 * Users can also opt to have the table of contents hidden. This is a user preference, set in Special:Preferences.

How do I change the interface text?
Interface text is altered using the MediaWiki namespace. For each deviation from the default in the site language there is a page MediaWiki:Englishmessagename, and for each deviation from the default in each other language a page MediaWiki:Englishmessagename/languagecode. (Since release 1.9 there are no pages for messages equal to the default.). On creation of a page the edit box autofills with the default. When creating a page to override the default it is useful to first save the default version, to allow diffs with it. See also Manual:System message.


 * For a list of system messages, see Special:Allmessages
 * To switch off the MediaWiki namespace, see the $wgUseDatabaseMessages configuration setting
 * To remove the Privacy policy or Disclaimers links at the bottom of each page, set the content of pages MediaWiki:Privacy or MediaWiki:Disclaimers respectively to a single minus sign.

How do I change the interface language?
To change the default interface language, alter the value of $wgLanguageCode</tt> in <tt>LocalSettings.php</tt>, e.g.



How can I prevent editing by anonymous users?
The recommended method is by changing the value of the  configuration option. Edit  and add the line:

For more information on using this option, see the Preventing access page and Manual:User rights.

How do I remove the article/edit etc tabs for users who are not logged in?
Edit MediaWiki:Monobook.css on your wiki, and add this:


 * 1) ca-edit { display: none; }

See the page source for the various #ca-* ids used in the content tabs.

Note: this will only work for MonoBook (the default skin), and doesn't actually stop people editing.

How do I add/remove tabs throughout my wiki?
For example, to remove the talk tab and then add a tab that always goes to the main page you would save this code in : and then add to the bottom of LocalSettings.php

How do I remove a tab on only one page?
''This solution works in MediaWiki version 1.9 and above. In MediaWiki version 1.8 or below, first apply the above patch.''

For example, to remove the Discussion (talk) page tab from the Main Page, on the MediaWiki:Monobook.css page add:

To modify MediaWiki:Monobook.css you must have administrative privileges.

How do I remove a tab on all pages
''This solution works in MediaWiki version 1.9 and above. In MediaWiki version 1.8 or below, first apply the above patch.''

For example, to remove the Discussion (talk) page tab on all wikipages, on the MediaWiki:Monobook.css page add:

Other tabs to remove are #ca-history and #ca-viewsource. To modify MediaWiki:Monobook.css you must have administrative privileges.

How do I hide the section edit links for users who are not logged in?
Edit  and add the line:
 * 1) The recommended method is by changing the value of the  configuration option.


 * 1) Alternatively you could manually edit each skin (e.g. ) and add this before  :


 * If you want to hide the links for all users including logged in users, instead edit  ('not recommended!) and add:


 * Also see How can I prevent editing by anonymous users?

How do I remove the "Talk for this IP" link at the top right when $wgDisableAnonTalk is true?
Set $wgShowIPinHeader to false.

How do I remove the "Create an Account or Login" link at the top right of the screen?
In Monobook.php change this statement: to:

How do I change the footer?
To add or remove items from the footer on your MediaWiki page, you must edit the skin.

For example: if you go in to MonoBook.php (located by default in the <tt>skins</tt> folder) you will find the following code:

In the above you can simply add and remove items from the footer that you wish to appear in your footer. Remember the changes may not appear immediately because of MediaWiki caches.

You can also customize the individual items by modifying certain pages or parameters:
 * lastmod - edit MediaWiki:Lastmodifiedat (verison 1.8 and after) or MediaWiki:Lastmodified (version 1.7 and before). If $wgMaxCredits is enabled, then edit MediaWiki:Lastmodifiedatby (verison 1.8 and after) or MediaWiki:lastmodifiedby (version 1.7 and before). (6518)
 * viewcount - edit MediaWiki:Viewcount
 * numberofwatchingusers - edit MediaWiki:Number of watching users pageview. This only appears if you also add  to LocalSettings.php.
 * copyright - edit MediaWiki:Copyright. The parameter $1 on that page is replaced with a link to the details of copyright for your wiki. In LocalSettings.php $wgRightsText for the link text and set either $wgRightsPage or $wgRightsUrl with the location of a wiki page or external URL.
 * privacy - this is a link only. Edit MediaWiki:Privacy for the link text and MediaWiki:Privacypage for the wiki page to which to link.
 * about - this is a link only. Edit MediaWiki:Aboutsite for the link text and MediaWiki:Aboutpage for the wiki page to which to link.
 * disclaimer - this is a link only. Edit MediaWiki:Disclaimers for the link text and MediaWiki:Disclaimerpage for the wiki page to which to link.
 * tagline - not currently used in the footer

See also: Footer, Manual:Skinning, Manual:Configuration settings

For line breaks in the footer, search for Content is available under in the MessagesEn.php and then put line breaks before and after so that it looks like  It is valid XHTML 1.0 Transitional. NOTE: It would probably be better to just edit the system message (see Special pages) to add before and after the message.
 * Line breaks in footer

How can I edit / remove the Powered by MediaWiki image in the footer?
You can hide the Powered by MediaWiki image by adding the following to your wiki's MediaWiki:Common.css:

If you want to remove it completely, you could alter <tt>/skins/MonoBook.php</tt>, which contains the following code that makes the Powered by MediaWiki image appear in the footer: If you would like to remove this image completely, or edit the image, you must locate and edit poweredbyico. It is located in <tt>skins/common/images/</tt> and the image is called <tt>poweredby_mediawiki_88x31.png</tt>.

If you're happy with the logo (or not) and simply want to change the destination link, the code is in getPoweredBy function of includes\Skin.php. Just change the line  $img = '<a href="http://www.mediawiki.org/"><img src="'.$url.'" alt="Powered by MediaWiki" /></a>';  to whatever.

How can I change what the of each page is? Where do I make changes?
Most of the text that you want to change, can be found in the namespace of MediaWiki.

In order to change titles, texts, announcements and the such, go to Special:Allmessages, where you will see the text associated with the pages you wish to change. You need to log in as an administrator (like the one you made when you installed) to edit the protected entries in the MediaWiki namespace.

If you want to change the title in your browser, you need to edit MediaWiki:Pagetitle. Go there and edit it just like you would any other page in your wiki.

In recent versions of MediaWiki, MediaWiki:Pagetitle is $1 - by default. If is producing the wrong text for you, you need to set $wgSitename in your LocalSettings.php.

If $wgSitename is correct in LocalSettings.php but is still wrong, it may be that you're using a user-contributed language file which incorrectly sets $wgSitename to a transliteration of "Wikipedia". Edit the language file to correct this. For example, the Hebrew language file is at <tt>languages/LanguageHe.php</tt> in your wiki directory.

Don't forget to clear your browser cache after you fix it.

How do I make external links open in a new window?
See Opening external links in a new window.

How can I suppress MediaWiki from formatting urls, tags, etc?
Put "  " tags around the url or tag. Example: svn co http://somwhere.in.the.net/myproject/ produces: svn co http://somewhere.in.the.net/myproject/

How can I force users to preview before they save?
See Manual:Force preview and Extension:ForcePreview.

How do I add more buttons on the edit page?
For adding more toolbar buttons above the edit field, you can use JavaScript code to register them in <tt>mwCustomEditButtons</tt> in your MediaWiki:Common.js. For example, a button for large text:

How can I get more special characters or tags clickable on the edit page?
For adding more selectable special characters, etc, below the edit field, See Extension:CharInsert

我应该怎样编辑一个页面
要编辑一个已经存在的页面，只需要单击这个页面上的编辑链接即可. 对于缺省的 Wiki 布局（MonoBook），这个链接位于页面顶部的标签页. 点击以后，用户会看到一个表单，待编辑的wiki页面内容会填充到表单输入区域中，用户编辑完毕后，可以点击表单下方的修改按钮以提交修改.

相关信息请参见:

如何创建一个新的页面
有几种方法创建一个新的wiki页面:

''在某些wiki系统中，搜索页面时如果没有找到任何结果，那么显示搜索结果的页面也会包含一个用于创建新页面的链接.
 * 从一个已经存在的页面创建一个链接，这时，这个链接对应的页面还不存在，因此显示红色，我们点击这个红色的页面就可以创建新的页面了.
 * 在浏览器地址栏上输入新的页面地址，例如： http://www.example.com/index.php?title=New_page ，然后点击编辑链接.

相关信息请参见 Help:Starting a new page

How do I delete an old version of a page?
Old versions of page data are retained in the database and can be accessed via the page history features. This is useful for reviewing changes and correcting or reverting undesirable ones, but in some cases, administrators might want to make this information unavailable, for legal reasons, or to reduce the size of the database.


 * Administrators can delete an old revision of a page by deleting the page, and then selectively undeleting revisions to be kept
 * The Oversight extension (also known as HideRevision) can be used to move harmful revisions out of page histories
 * The <tt>maintenance/deleteOldRevisions.php</tt> maintenance script can mass-delete all old revisions of pages and their associated text records.
 * See also: Manual:Removing embarrassment.

Are there any editing tutorials available?
There are several editing tutorials available, mostly on Wikimedia sister projects, such as Wikipedia. There are also markup references, etc. available on Meta.


 * Editing help content on Meta
 * The How to edit a page guide on the English Wikipedia

How do I view the printable form of a page?
MediaWiki includes stylesheets which automatically style a page appropriately when it is printed; using the print or print preview function within your browser ought to render the page in a printable form.

You can also view this printable form using the printable version link in the toolbox.

Importing from MediaWiki XML dumps
See Manual:Importing XML dumps

Importing from other types of wiki software
Note: The following is directly copied from old meta FAQ. It might need to be corrected.

There is some documentation about importing in the UPGRADE file distributed with MediaWiki.

To follow on from those, this is how at least one individual imported pages from usemod to MediaWiki:

Because MediaWiki does not automatically link to CamelCase style links, you will need to add brackets  to all your links. You can do this with the following:

First, obtain ImportStage1.txt (or whatever you want to call it) from the importUseModWiki.php script ( use > to pipe the output to a file )

Second, do

sed '/Importing/!s/\ [A-Z]\w*[a-z]\w*[A-Z]\w*[a-zA-Z]/\ \[\[&\]\] /g' ImportStage1.txt > ImportStage2.txt

This should create proper links in place of your CamelCase links.

This doesn't work so well for SubPage links - someone care to fix?

Then,

sed 's/upload\:\w*\.\w*/http\:\/\/aberwiki\.org\/uploads\/& /g' ImportStage2.txt > ImportStage3.txt

This fixes your upload links. Change the replace text so it fills in your url such as http://www.yourwiki.org/uploads/filename

You are now ready to import ImportStage3.txt into your database with a command such as

mysql -u -p < ImportStage3.txt

Note: If your  outputs an XML file instead of SQL statements, this probably means you have a rather new version of MediaWiki. In such a case, you case import the XML file -- see Importing a Wikipedia database dump into MediaWiki, towards the bottom of the page ('Import XML'). Don't forget to rebuild all the tables -- that page also explains how to do that.

Importing from other types of files
Here are some info on importing from other types of files:


 * Massive text files importing
 * Massive image files uploading
 * Tools to converter from html to MediaWiki, and this.
 * Tools to converter from Microsoft .chm help files to MediaWiki

MediaWiki auto importing script
Taken from wiki_import - MediaWiki auto import script:

Description
The script is designed to import a whole folder of files into MediaWiki, with the folder directory tree mapped as wiki category hierarchy.

Features

 * economic, build wiki site from existing knowledge base collection without "double-entry"
 * persistent, map folder directory tree as wiki category hierarchy
 * sophisticated, import/handle all well-known file types automatically
 * complete, cover every applicable scenario, even the case when you need to control access to individual wiki pages
 * versatile, highly customizable

Quick Help
<tt> wiki_import.sh $ $Revision: 1.1 $

mediawiki automatic file import script

Usage: wiki_import.sh [OPTIONS]...

The script is designed to import a whole folder of files into mediawiki, with the folder directory tree mapped as wiki category hierarchy.

The specification of the file-to-import is passed from standard input.

Options: -s, --sect=n    the root category section of the wiki of the imported article (mandatory) -1, --header    include standard header (category hierarchy path & notice) -l, --link      link to actual file on the web site -f, --footer    include standard footer (article category) -R, --res[=p]   add restricted tag in the footer as '' (default=`$_opt_sect')

Configuration Options: -p, --php=fn    mediawiki import php script specification -r, --root=n    the root category name for the whole wiki site -m, --max=n     max_allowed_packet for mysqld to import -u, --user=n    wiki user used for the import -a, --arch=p    the root url that linked-to archive files based on

Examples:

echo ./path/to/file.ext | wiki_import.sh -1 -l -f -s 'Customer Support' -R </tt>

For the rest of details, check out wiki_import.

How can I allow use of HTML tags?
See Manual:$wgRawHtml as well as Manual:$wgGroupPermissions and Manual:Preventing access.

This can be easily abused to attack users

See Extension:SecureHTML and Extension:HTMLets for ways to make this safe(er).

How can I allow uploading of HTML files?
See Manual:Allowing HTML Uploads.

This can be easily abused to attack users

Ķ==Why...?==

…is the Help namespace empty?
We don't currently have a clean, internationalised set of help pages under a free license. A few developers are hoping to make this possible; however, the Help namespace currently ships in a blank state. You are free to add your own help pages, copy the Public Domain help pages or copy certain of the items from Meta, e.g. the user guide or MediaWiki Handbook, these two collections being free to use under the GNU Free Documentation License.

…are some of my images not showing up after an upgrade?
Several users have reported that, following an upgrade or a moving of their wiki, several images fail to be shown inline. The files exist, and the image description pages show a MIME type of <tt>unknown / unknown</tt> and, in some cases, a warning about potentially dangerous files.

To fix this, run the <tt>maintenance/rebuildImages.php</tt> script from the command line. This will set MIME information for each file in the database.

…are all PNG files not being turned into thumbnails?
After upgrading to a more recent version of PHP, it is possible a different MimeMagic.php function is being used to detect file MIME types, particularly the built-in PHP function mime_content_type, which fails to detect PNG files. Search the web for mime_content_type png for

…is a search for a short keyword giving no hits?
By default, MediaWiki uses MyISAM's fulltext matching functionality to allow searching page content. The default settings for this mean that words of less than four characters won't be indexed, so results won't be returned for those queries.

To alter this behaviour, MySQL needs to be reconfigured to index shorter terms, and MediaWiki's search index table needs to be repaired, to rebuild the indices.


 * For help on reconfiguring MySQL, see http://dev.mysql.com/doc/refman/4.1/en/fulltext-fine-tuning.html
 * To repair the search index table, run the query  against your database

…can't I download MediaWiki 1.14?
MediaWiki 1.14 is in a development state at present, and has not been packaged into a general release. The code can be downloaded from Subversion if desired.

…doesn't this work? It works on Wikipedia!
Wikipedia and other Wikimedia web sites use the current version of the code in development; at present, this is MediaWiki 1.14alpha. Coupled with the use of several extensions, this means that functionality between these wikis and your particular setup may differ.


 * To obtain the current development code, read Important Release Notes
 * To check what version a Wikimedia wiki is running, as well as what extensions are installed, visit the Special:Version page for that wiki

…do I get a 403 Forbidden error after setting permissions on my Fedora system?
Fedora Core enables SELinux by default. Instructions for setting SELinux permissions for MediaWiki are available.

…do I get logged out constantly?
This is probably related to cookies or session data, for example a problem with PHP's session.save_path setting. See Log in problems.

…is it a good idea to keep user accounts?
At many times you just want to remove a user account out of the wiki either because it belonged to a spammer account or you just feel like it. The appropriate choice is to block the account or rename it if needed. Here is why:

Do I just remove his row from the User table?

Rob Church posted the following regarding this issue on the mediawiki-l mailing list:

"If the user has made edits, then removing rows from the user table cause theoretical loss of referential integrity. Now, to be honest with you, I can't think of any conditions where this would cause an actual problem; "undefined behaviour" is the phrase we use.

What I'd suggest doing, to be on the safe side, is running a couple of quick updates against the database:



What this will do is cause MediaWiki to treat the revisions as having been made anonymously when generating things like page histories, which should eliminate any problems caused by these routines attempting to check user details from other tables.

If the user has caused log entries, i.e. rows in the logging table, or uploaded images, then the situation becomes trickier, as you'll have to start mopping up all the rows everywhere and it could become a bit of a mess, so if the user's done anything other than edit, I would strongly recommend just blocking them indefinitely.

If the username is offensive or undesirable, then you could consider renaming it using the RenameUser extension."

Anti-spam
See Manual:Combating spam for an overview of anti-spam measures.

Where do I get the spam blacklist from and how do I install it?
The spam blacklist extension can be found in Subversion, just like all other officially supported extensions. For installation and configuration instructions, consult the README file and extension page over here.

How do I use $wgSpamRegex to block more than one string?
$wgSpamRegex is a powerful filter for page content. Adding multiple items to the regex, however, can be awkward. Consider this snippet:

This example code allows convenient addition of additional items to the regex without fiddling about each time. It also demonstrates two popular filters, which block some of the most common spam attacks.


 * See also: Extension:SpamRegex

I've found a bug or have a feature request. Where do I post it?
Bugs and feature requests should be posted on MediaZilla, our implementation of Bugzilla. Please search the database prior to posting, to avoid creating duplicate entries.

I'm getting a strange error. What now?

 * See if it is covered by Manual:Errors and Symptoms
 * Try to find out more about the problem, see How to debug MediaWiki
 * See the section below for information on how to contact developers and other knowledgabe users.

I have a question not answered here. Where do I go next?
If you've exhausted the FAQ above, please try the following:


 * Check the other sources of help on this site
 * Search the rest of this site
 * Search older documentation archived on Meta; Useful developer documentation remains on Meta.wikimedia.org in the category Pages to be exported to MediaWiki.org until the m:Meta:MetaProject to transfer content to MediaWiki.org completes
 * Search the web
 * Dig into the source
 * See the section below for information on how to contact developers and other knowledgabe users.

Still no luck. Where can I ask for help?

 * Post a message at Project:Support desk
 * Email the mediawiki-l mailing list (perhaps search the archive first).
 * Ask the developers in our IRC channel (Freenode network, channel #mediawiki).

推荐阅读

 * 提问的智慧 注:请使用代理访问.本文含有中文版
 * 如何有效的报告BUG 注:本文含有中文版
 * 如何使用IRC频道获得有价值的帮助
 * 书名: MediaWiki Administrators' Tutorial Guide(mediawiki站长指导),作者:Mizanur Rahman,ISBN 1904811590