User:Zhangjintao/zh



本FAQ是英文版的译本,可能不是最新的.

MediaWiki, Wikimedia(维基媒体基金会), Wikipedia(维基百科)和wiki间的区别是什么?
这个问题经常被问到,请参阅Wikipedia、Wikimedia、MediaWiki 和 wiki 的区别页面获得更详细的答案.

我能将MediaWiki用于某个用途么?
MediaWiki是自由软件,这意味着你可以以任意方式使用它而不需要法律上的许可.你的wiki上的内容可以采用不同的协议.当然,作为支持维基百科运行的软件而发展起来的项目,我们鼓励你使用一个自由许可证授权你的wiki上的内容,但是这不是必须的.

如果你希望修改MediaWiki软件,没有问题!但是这里有一些限制,查看GNU 通用公共许可证第二版的全文了解详细信息.因为MediaWiki是免费使用的，在适用的法律允许的范围内没有担保责任.

到哪里里下载MediaWiki?
点击这里前往下载页. 你会下载到一个.tar.gz归档文件. 你也可以 通过Git从我们的版本库中下载.

如何安装MediaWiki?
安装MediaWiki的预计时间为10到30分钟,包括上传与复制文件,和运行设置脚本.请参阅[Manual:Installation guide|安装指南]],你也可以在那里找到系统需求.

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

但是请注意因为软件源中的MediaWiki可能不是最新的，所以请密切关注你所使用的扩展的兼容性.


 * 另请参阅: MediaWiki软件套装（英文）

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

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

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

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

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

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

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

如何安装扩展?
参见Manual:Extensions获取安装插件与编写插件的相关信息. 参见Category:插件以寻找已有的插件.

如何添加额外的名字空间?
参阅Creating a custom namespace.

如何启用文件上传?
文件上传是MediaWiki常用的功能之一，但在目前所有的发行版中都被默认关闭了. 要启用它们，首先要让网站服务器上的上传文件夹（默认为 ）可被写入（chmod 777或允许Apache用户写入内容，等等），然后在LocalSettings.php中将$wgEnableUploads设为 值（例如“$wgEnableUploads = true;”）. 如果你在上传时遇到了一个"failed to mkdir" （无法创建文件夹）错误，你可能需要调整你的服务器上的文件权限.


 * 也请参阅：Manual:Configuring file uploads

如何在MediaWiki中显示数学公式?
MediaWiki允许用户插入数学公式. 参见Manual:Math获取安装指南.

如何设置我的Wiki的时区?

 * 请参阅： Manual:Timezone

如何强制刷新一个缓存页面?
有时您需要刷新被缓存的页面，比如当页面的导航栏发生了变化后. 在页面的动态URL后加上 即可.

例如：http://www.mediawiki.org/w/index.php?title=Main_Page&action=purge 或在页面的短型URL后加上 ： 例如：http://www.mediawiki.org/wiki/Main_Page?action=purge
 * 也请参阅：Manual:Purge, Manual:Parameters to index.php.

如何完全停用缓存?
将下列语句加入LocalSettings.php即可： $wgEnableParserCache = false; $wgCachePages = false;

如何允许上传其他格式的文件?
MediaWiki requires that allowed file upload formats are specified using the $wgFileExtensions configuration directive. Usually this directive is situated in LocalSettings.php in the root of your MediaWiki installation.

For example, to extend uploading to PDF files, add the following to LocalSettings.php:

To extend uploading to more than one type of file, use the following syntax


 * 也请参阅：Manual:Configuring file uploads

"文件已损坏或者扩展名不正确"
有些用户报告说，在向已允许扩展名列表中增加文件格式后，软件会发生错误. 出错后的文字类似于下方：
 * 文件已损坏或存在无效扩展名. 请重新检查并上传文件. 

可能的解决方案：*设定$wgMimeDetectorCommand的值，例如：在Unix或Linux，您可以将它设为  :  
 * 编译／安装PHP插件fileinfo
 * Fedora - yum install php-pecl-Fileinfo


 * 也请参阅：Manual:Mime type detection.code>

安装程序没创建一个管理员用户?
Sometimes, the installer fails to create the default user, or the user table is lost for some reason. There are a couple of options for solving this:

maintenance/createAndPromote.php

 * If your MediaWiki is older than 1.16, make sure  is set up (参阅 )
 * Execute  from the shell. Append   to command line if you want that user to become a bureaucrat, in addition to becoming an administrator.

This will create a new user and promote them to an administrator. For help, run the script with the parameter.

在数据库中修改

 * Register a new account using the regular method (Special:UserLogin).
 * Check the user ID in Special:Preferences.
 * Execute the following SQL statement against the database:
 * above should be replaced with the appropriate user ID which you can 参阅on the user's preference page.
 * Note: if  is defined in LocalSettings.php, prepend its value to the table name. For example, if   is "XYZ", then the table name to use is.
 * Note: if  is defined in LocalSettings.php, prepend its value to the table name. For example, if   is "XYZ", then the table name to use is.

临时允许任何人修改用户权限,然后给初始化事创建的用户分配权限
This method essentially involves letting all users temporarily modify user permissions in order to promote one user
 * Register a new account using the regular method (Special:UserLogin). Be logged in using that account.
 * Add the following lines to the bottom of LocalSettings.php
 * Go to special:userrights and add the user you just created to the Administrator and Bureaucrat groups.
 * Remove the  line from your LocalSettings.php . This step is very important, as until you remove it anyone can alter permissions, which is bad.
 * Remove the  line from your LocalSettings.php . This step is very important, as until you remove it anyone can alter permissions, which is bad.

如何重置密码?

 * 参阅 Manual:Resetting passwords

如何创建或修改跨wiki链接?

 * 参阅 Manual:Interwiki

如何让显示的URL更短?
(例如用 /wiki/Article_Name as opposed 取代 /w/index.php?title=Article_Name)
 * 参阅 Manual:Short URL

我能像目录一样组织页面吗,像/wiki/subdir/PageName这样?

 * 参阅 Manual:$wgNamespacesWithSubpages, Help:Subpages

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

如何管理用户权限?
 参见Manual:用户权限与Manual:用户权限管理获取常见的信息. 参见Manual:访问控制获取限制访问的方法与措施.

如何阻止匿名用户编辑页面?
The recommended method is by changing the value of the  configuration option. Edit  and add the line:

If you use Extension:AbuseFilter, any admin can also disable IP editing temporarily as needed.


 * 也请参阅：Preventing access, Manual:User rights.

如何阻止匿名用户创建页面?
也请参阅 Manual:$wgWhitelistRead. 参阅Manual:Preventing access for more information.
 * Add this to the bottom of LocalSettings.php:

如何阻止创建账户?
参阅Manual:Preventing access for more information.
 * Add this to the bottom of LocalSettings.php:

如何在注册时要求提供电子邮件地址?

 * 参阅Manual:$wgEmailConfirmToEdit

如何让MediaWiki只读?

 * 参阅Manual:$wgReadOnly

如何修改默认的用户设置?
The MediaWiki default user preferences are in the language file, i.e.  if you're using English. Don't edit that file, just use it for reference, like you do with DefaultSettings.php.

Say if you want to change the default number of search results on a page. Language.php says:

To change it to 50, put this in your LocalSettings.php: Note that you are setting $wgDefaultUserOptions, which contains the site overrides, not $wgDefaultUserOptionsEn, which contains the software defaults. Any settings in $wgDefaultUserOptions will override those set in the language file.

To change the default namespaces to be searched, in any version of MediaWiki, set $wgNamespacesToBeSearchedDefault in LocalSettings.php to an array mapping namespace indexes to boolean values. For example, to search the main namespace and the category namespace, use:

$wgNamespacesToBeSearchedDefault = array(    NS_MAIN => true,     NS_CATEGORY => true, );

In some cases, after you change a default user preference, you may also want to change the user preferences of all existing user accounts.

If so, use the userOptions.php script in the Maintenance directory. Use the "--dry" option for the first run, assess the impact and go from there. (--dry does not write the database)

php userOptions.php --dry --nowarn searchlimit --old 20 --new 50

Also, always backup your database before making these kinds of changes (you do not need to do use if you are just using --dry).


 * ''也请参阅：Manual:$wgDefaultUserOptions

如何优化MediaWiki的运行速度?

 * 请参阅： Manual:Performance tuning

如何启用搜索建议?

 * 请参阅： Manual:Enabling autocomplete in search box

升级

 * 请参阅： Manual:Upgrading

能把我的wiki移动到另一台电脑上吗?
Yes. It should be. In essence, you will be backing up your old installation and then "restoring" it onto the new machine. Finally, you will have to make additional modifications to update the wiki configuration so that everything points to the new location.

那么,如何做?
Follow the instructions at Manual:Moving a wiki.

如何修改左上角的标志?
The logo that appears in the top left of each page is determined by the $wgLogo configuration line in the LocalSettings.php file.

There are two ways to change the logo:


 * 1) Upload a picture to your wiki using the normal file uploading interface. This allows the logo to be replaced easily, so you may want to protect the page if you use this method.
 * Then add the $wgLogo line to LocalSettings.php, for example:
 * 1) Upload an image to your server by other means (such as FTP).
 * Add the $wgLogo line to LocalSettings.php, for example:
 * (In this example, the image is in the same folder as the LocalSettings.php file.)
 * (In this example, the image is in the same folder as the LocalSettings.php file.)
 * (In this example, the image is in the same folder as the LocalSettings.php file.)

If you want to change the logo in only specific pages, override #p-logo css's background-image property or use third party extension like Extension:LogoFunctions.

如何编辑wiki的CSS?
You shouldn't edit the CSS files (such as main.css) directly, because it will make upgrading harder if you need to apply your customizations each time you upgrade the software. Instead you need to edit a wiki page called MediaWiki:Common.css if you want to apply your CSS changes for all skins, or a wiki page called MediaWiki:Monobook.css if you want to apply the customizations only for Monobook skin.

The content of MediaWiki:Common.css and MediaWiki:Monobook.css pages always override the default CSS styles specified in main.css.

如何隐藏左侧的导航栏
In other words, how do you make the main content div take up 100% of the display, hiding the logo, toolbox, navigation and search engine?

To hide it permanently, copy and paste the following into the MediaWiki:Common.css page:

To instead hide the toolbar when the user presses F11, enter this in your wiki's MediaWiki:Common.js:

如何隐藏页面底部的分类列表?
You can hide display of the categories on each page by modifying your MediaWiki:Common.css and adding:

我能自定义左侧顶部的标志吗,如果可以的话,怎样做?
The logo is a portlet block without a pBody section. It is identified by the p-logo id. The background image is specified by the $wgLogo variable, which is defined in DefaultSettings.php. This location is relative to the web server root and not the system root. Redefine this in LocalSettings.php to change the image. If set wrong there will be no image on the page; check your web server error log and adjust accordingly. However the size of the p-logo will need to be big enough for the logo if it is not to be clipped. This is set in the stylesheet (main.css in Monobook), under the p-logo style, the default setting is:

Note, if you are using a different sized logo, and want to change the CSS, please do not modify any of the core MediaWiki stylesheets. Instead add to the on-wiki css page (MediaWiki:Monobook.css for monobook, MediaWiki:Vector.css for vector. MediaWiki:Common.css will also work for all skins)

如何改变点击左上角的标志后跳转到的页面?
By default, clicking the site-logo takes you to the main site-page. If you want to change which internal site-page is the "main" site-page, edit MediaWiki:Mainpage.

To make the link of the site-logo link externally to any other arbitrary URL, you can add a hook to your LocalSettings.php to override the mainpage href which is used by 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:

如何改变地址栏的图标 (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

参阅Manual:$wgFavicon for more details.

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

Rewrite 规则
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.

注意区分大小写
When uploading the favicon file, be sure the filename is in lowercase. (That is, "favicon.ico", not "Favicon.ico".) A lot of servers (e.g., those on UNIX-like operating systems) will not be able to find the file unless its name is in lowercase.

如何定义导航栏?
使用Monobook皮肤的每一个页面左边是导航条，其内容由您的wiki上的MediaWiki:Sidebar 页面决定. 定制这些内容的相关信息，请参看Manual:Interface/Sidebar.

如何在每一个页面上放置一个消息(站点通告)?
Put a text in the MediaWiki:Sitenotice page. It will be displayed on top of every article page.

You can also add text to MediaWiki:Anonnotice to create a message that only displays for logged-out users. It is often a good idea to transclude the site notice on the anon notice to make sure that logged-out users still get the information on the site notice,

如何指定首页?
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.

如何改变首页的标题?
Simply click on the "Move" tab, and move the page to the desired page title.

Usually you also want to change which page is the configured as "main page".

如何在首页隐藏标题?
MediaWiki does not have a built-in option to hide the main page title (参阅), but you can use CSS to hide the title. Alternately, you can use the NoTitle extension.

Add the following to on your wiki:

If this doesn't work, you may be using a skin that doesn't support this, or you moved your main page without updating MediaWiki:Mainpage, or you have a really old MediaWiki version.

If the skin uses a different element for the title than a  element with class , you'll need to find the appropriate CSS selector to apply for that skin.

如何隐藏目录?
The table of contents (TOC) is automatically shown once there are four or more headings in the article. There are multiple ways to hide it.

某个页面

 * Place the magic word  in the page's wikitext.


 * 所有页面
 * Install Extension:NoTOC
 * or
 * Add the following rule to MediaWiki:Common.css:


 * 单个用户
 * Users can add the same CSS rule to their common.css personal stylesheet.


 * There was a user preference to hide the table of contents, it was removed in MediaWiki 1.23 (T54813).

如何改变界面文字?
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. 也请参阅 Manual:System message.


 * For a list of system messages, 参阅Special:Allmessages
 * To switch off the MediaWiki namespace, 参阅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 hyphen.

如何改变界面文字语言?
To change the default interface language, alter the value of  in , for example

You may also need to bypass your browser's cache to 参阅the changes.

The new default interface language will be applied to all users who haven't ever customised it.

If you want to provide users the possibility to create and choose pages and interface elements in languages other than the default one of the wiki, you need the Translate extension, which can make your wiki multilingual.

如何去除某个标签(例如"文章"或"编辑")?
For a little more control 请参阅： User:Subfader/Hide_page_tabs

Edit MediaWiki:Common.css on your wiki, and add this:

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

Note: this will only work for Monobook and derived skins such as Modern and Vector (the default skin), and doesn't actually stop people from editing. To do that, 参阅Manual:User rights.

如何增加一个标签?
Use Extension:DynamicTabs on older MediaWiki installations or write your own extension (请参阅： Manual:Hooks/SkinTemplateNavigation):

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

如何去除某个页面上的某个标签?
For example, to remove the Discussion (talk) page tab from the Main Page, on the MediaWiki:Common.css page add:

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


 * 也请参阅：Manual:Hide page tabs

去除所有页面上的某一个标签
For example, to remove the Discussion (talk) page tab on all wikipages, on the MediaWiki:Common.css page add:

Other tabs to remove are #ca-history, #ca-viewsource, #ca-view (Read tab), #ca-nstab-main (Page tab), #ca-viewsource.

Other drop down menu items you can remove are #ca-watch, #ca-move, #ca-delete.

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

如何对匿名用户隐藏"编辑段落"链接?
You can change the value of the configuration option.

Edit and add the line:


 * Also 参阅

如果 $wgDisableAnonTalk为真,如何去除"关于此IP地址的讨论"按钮?
Set $wgShowIPinHeader to false.

如何移除"登录/创建账户"链接?
To remove the login / create account links from the personal_urls you can use this code in your to hook in and remove them:

如何限制某些操作和访问特殊页面?

 * NOTE: MediaWiki is not designed for this kind of usage! It should be noted that the following 'answer' is a hack that only 'works' with the Apache webserver. Note also that this system is not foolproof, it's just one step further than hiding the links (参阅above).

Suppressing actions and special pages can be useful when you want to create the illusion of a static website via a particular URL or VirtualHost, but also have an 'internal' view that is a true wiki. i.e. if you have an inward facing 'view' of your wiki that users can edit, and an outward facing 'view' that should appear like a static website (no history, no discussion, etc., etc.).

After hiding all the appropriate links (参阅above), if you are using the Apache web server, you can disable actions and special pages using the following rewrite rules:


 * 1) Lock down the site (disable MediaWiki commands)

RewriteEngine On


 * 1) RewriteLog /tmp/rewrite.log


 * 1) RewriteLogLevel 9


 * 1) 参阅http://www.mediawiki.org/wiki/Manual:Parameters_to_index.php#Actions

RewriteCond %{QUERY_STRING} (.*action=.*) RewriteRule .* http://www.my.domain.com?

RewriteCond %{REQUEST_URI} !^/index.php/Special:Search RewriteCond %{REQUEST_URI} ^(.*Special:.*) RewriteRule .* http://www.my.domain.com?

RewriteCond %{QUERY_STRING} ^(.*Special:.*) RewriteRule .* http://www.my.domain.com?
 * 1) Catch a trick...

Above, a request for, for example, will be simply rewritten to. Similarly any page in the Special namespace (with the exception of Special:Search) will be rewritten to. Remember, this is only a hack, and isn't intended as a solution for a secure CMS.

Note that you will need to adjust the above rules to match your specific URL naming schema.

Other issues to consider when trying to lock down a site like this is the API and POST requests for the wiki content (rather than GET).

如何编辑系统消息?
Special:Allmessages contains a complete list of messages (error or otherwise), that can be edited.

如何改变页脚?

 * 参阅Manual:Footer and Manual:Configuration settings

如何移除页脚中的"Powered by MediaWiki"图像?
You can hide the Powered by MediaWiki image by adding the following to your wiki's MediaWiki:Common.css:

The Vector skin equivalent is:

In MW 1.17 with Vector Skin:

In MW 1.18 with Vector Skin:

If you want to remove it completely in 1.17 you can use to remove it using this in your :

In 1.16 and below you will have to use a hook to remove it:

If you wish to change the icon images, urls, alt text, or add new icons please 参阅' documentation.

如何自订签名消息(例如增加一个回复链接)?
You can customize at: MediaWiki:Signature / MediaWiki:Signature-anon

For example, changing the entries to  will put a link to users' talk pages and   would give a more direct link.

Users can change it their preferences.

能改变每个页面的标题吗,怎样做?
Most of the text that you want to change can be found in the namespace of MediaWiki.

In order to change titles, texts, announcements, etc., go to Special:AllMessages, where you will 参阅the text associated with the pages you wish to change. You need to log in as an administrator 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  in your wiki directory.

Don't forget to clear your browser cache after you change your settings.

MediaWiki能自动首字母大写$wgSitename吗?
Yes. This can be changed using the $wgCapitalLinks configuration setting.

如何在新窗口打开外部链接?

 * 参阅Opening external links in a new window

我能阻止MediaWiki格式化文本吗?
Put "  " tags around the URL or tag.

Example: svn co http://svn.example.com/myproject/

Produces: svn co http://svn.example.com/myproject/

如何强制用户先预览再提交编辑?

 * 请参阅： Manual:Force preview and Extension:ForcePreview

如何在编辑页面上增加更多按钮?

 * 请参阅： Manual:Custom edit buttons

如何增加插入字符的链接?
For adding more selectable special characters, etc., below the edit field, 参阅Extension:CharInsert.

如何在自己的wiki上使用维基百科的默认皮肤(Vector)?
Vector was introduced in MediaWiki version 1.16, and was made the default skin in 1.17. 参阅Manual:$wgDefaultSkin for more information on configuring your default skin.

Additional features of the Vector skin are made available using the Vector extensions, which you must download and install separately.

如何在显示打版本时不显示外部链接?
Edit the page MediaWiki:Print.css on your wiki and add the following code there:

This will override the styles defined in skins/common/commonPrint.css in MediaWiki source code. For more information, 参阅Manual:CSS.

If instead you want to have the external links underlined in the printable version, then also add the following code:

如何改变首页上的标签的名称?
To change the text of the tab, as one example used in Wikipedia, you first open the page " ".

After you've done that, click Edit and type in the edit box the text you want to be seen later on the main page - that's it. Don't forget to save the page as well.

如何编辑页面?
To edit a page, simply click the edit link that appears on each page. Using the default Vector skin, this is in the form of a tab at the top of the page. A form will appear, containing the existing markup. When you have finished making modifications, click the Save button to commit your changes.


 * 也请参阅：Help:Editing pages

如何创建一个页面?
There are several ways to create a new page:

On some wikis, a failed search for a page will contain a link which allows you to edit that page.
 * Create a link to the page on another page, then click on the red link which appears
 * Browse to the intended location of the page, e.g.  and click on the "Edit", "Create" or "Create source" link.


 * 也请参阅：Help:Starting a new 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 on older versions of MediaWiki (<1.16).
 * For newer MediaWikis (1.14+), you can enable the core RevisionDelete feature that allows privileged users to remove single revisions from page histories.
 * The  maintenance script can mass-delete all old revisions of pages and their associated text records.


 * 也请参阅：Manual:Removing embarrassment

如何删除某个页面的某些版本?

 * 请参阅： RevisionDelete

You can also delete a page, and then restore only the revisions you want.

有没有一个编辑教程?
There are several editing tutorials available, mostly on Wikimedia sister projects, such as Wikipedia. There are also markup references, etc. available on Meta.


 * The page Help:Editing pages on this site
 * Editing help content on Meta
 * The How to edit a page guide on the English Wikipedia

如何查看某个页面的打印版本?
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 sidebar under Toolbox or Print/export if using the Collection extension.

如何使用模板?

 * 参阅Help:Templates

我能使用维基共享资源上的多媒体文件吗?
Yes, this is encouraged through the use of Manual:$wgUseInstantCommons.


 * 也请参阅：InstantCommons

如使用一个模板作为签名?
When you look at your preferences, you 参阅a check box for "raw signature." But the field will only take a certain number of characters. What if you want more?

You will need to create two pages, possibly in your userspace.


 * 1) Create the first page (FIRST PAGE)
 * 2) Go to your preferences, check "raw signature" and put  in the signature.  Save
 * 3) Create a second page (SECOND PAGE) (possibly a sub-page of the first)
 * 4) Go back to the first page (FIRST PAGE) and do
 * 5) Go to the second page (SECOND PAGE) and place the code you wish to have for your signature.

If you don't have this structure, you will still be inserting all your signature code into the raw code wherever your signature is used, because the software will insert "SUBST" in your preferences. You may not mind this, in which case you only need one page. If you want the raw code to only display, which looks a lot cleaner, then you need to use the two-page structure.

如何加入沙盒功能?
In wiki terms, a sandbox is simply a "play pen"; a page which users can mess about in. This is an ordinary page created in the normal manner, and can be located wherever you like. There is no special sandbox functionality built into MediaWiki.

Users often inquire about the Wikipedia sandboxes, which seem to be self-emptying. This is not quite correct; there are a number of volunteers who run bots to clean these up and return them to a certain state at regular time intervals.

如何在个人工具栏(右上角)加入一个沙盒链接?
You need to add the Gadget extension and add the Sandbox gadget. You will probably also want to make it a default gadget.

如何运行一个多语言wiki?
To make your wiki multilingual and a tool for translation, allowing translation of pages and of the custom interface (like the sidebar), use the Translate extension; there's extensive documentation.

从MediaWiki XML 转储中导入

 * 参阅Manual:Importing XML dumps

从其他wiki软件迁移
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 can import the XML file -- 参阅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.

从其他类型文件中导入
There are a variety of tools available to help convert content from HTML (and other formats) to MediaWiki markup.


 * 开发者和系统管理员工具
 * HTML::WikiConverter::MediaWiki - a Perl module for converting from HTML to MediaWiki markup.
 * Wikificator - a Javascript MediaWiki extension that converts XHTML to MediaWiki markup.
 * The Edit.php, importImages.php and ImportTextFile.php maintenance scripts can be used to import text and images into MediaWiki.


 * 用户工具
 * HTML to Wiki Converter - an online HTML to MediaWiki markup conversion service. (Based on HTML::WikiConverter::MediaWiki)
 * wikEd - a text editor for MediaWiki that can import HTML (including Microsoft Word-generated HTML.)


 * 指南
 * Brief notes on converting from Microsoft .chm help files to MediaWiki
 * Notes on converting from Microsoft Office formats to MediaWiki

MediaWiki自动导入脚本
Taken from wiki_import - MediaWiki auto import script:

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

功能

 * 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

快速参考
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

For the rest of details, check out wiki_import.

从其他网站(例如维基百科)导入的模板不工作
You probably need to install some extensions used on the source wiki, such as ParserFunctions or sometimes Cite. Also, make sure that you copied all site CSS and JavaScript required by the template.

如何让多个wiki使用一个凭据登录?

 * If you're starting from scratch or you're switching from one wiki to multiple, you can use $wgSharedDB and $wgSharedTables to have all wikis share the user table of the "main" wiki. You can share other tables as well, as long as they don't contain any data dependent on non-shared tables or data specific to one wiki. 参阅Manual:Shared database for examples and more information.
 * If your wikis are already established and you want to switch to a single sign-on, you can use the CentralAuth extension. It has a few more features than a shared user table, but it's more difficult to configure and it's tailored toward a Wikimedia-style setup. However, it is easier than attempting to completely merge multiple user tables into one.

如何允许HTML标签?
参阅Manual:$wgRawHtml as well as Manual:$wgGroupPermissions and Manual:Preventing access.

参阅Extension:SecureHTML and Extension:HTMLets for ways to make this safer.

如何为MediaWiki增加新功能或是修复bug?
The basic steps to improving MediaWiki (that is, becoming a MediaWiki developer) are:


 * Install Git
 * Download the Git "clone" of the MediaWiki source code
 * Get a server, a database, and PHP running on your computer (this can be annoying, so please ask for help if something isn't working)
 * Get MediaWiki running on your computer off that Git checkout (can be annoying as well, so, ditto)
 * Fix the problem or add the feature you were thinking of, or if you don't have one in mind, look at one of the "annoying little bug"s
 * Edit the source code of the relevant file(s) to fix the problem
 * Follow Gerrit/Tutorial

如何运行一个机器人?

 * 参阅Manual:Bots

You might want to use the Pywikibot framework.

如何设置 noindex nofollow
Set  in LocalSettings.php

如何设置一个小型wiki 农场?

 * 请参阅： Manual:Wiki family

如何添加meta标签?
The OutputPage class includes an addMeta methods which can be used to add meta tags. The RequestContext can be used to get the relevant OutputPage object.

To add further Meta tags just add further lines as last lines of the function addMetaTags like:

$out->addMeta ( 'description', 'This is a meta description.' );

…帮助名字空间是空的?
The Help namespace currently ships in a blank state. It's up to you how much or how little help you give to your site visitors and whether this relates to other aspects of your site. Obviously you can easily link your visitors to help resources elsewhere.

We don't currently have a clean, internationalised set of help pages under a free license. However, if you want to copy in some help information onto your site, about how to use a wiki (a MediaWiki powered wiki) you are free to copy the Help:Contents from this wiki. This set of pages have been deliberately created for this purpose, with wiki-neutral information, and no license restrictions. 参阅Project:PD help. More help is available at the Meta-Wiki MediaWiki Handbook.

…升级后某些图像无法显示?
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  and, in some cases, a warning about potentially dangerous files.

To fix this, run the  script from the command line. This will set MIME information for each file in the database.

…png格式的图片没有缩略图?
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 information on fixing this bug at the PHP level, possibly by editing your magic.mime file.

参阅here for more info.

…搜索一个wiki内容中的关键字却没有结果?
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 will be ignored in searches with older versions of MediaWiki.

MediaWiki 1.13 and earlier are unable to work around this; you must either change MySQL's configuration to index shorter words, or upgrade to a more recent version of MediaWiki.

Note that some particular words may still not be indexed if they are in MySQL's default stopword list.

…不能下载MediaWiki1.26?
MediaWiki 0000 is in a development state at present, and has not been packaged into a general release. The code can be downloaded from Git if desired. Or, if you want the latest development version packaged as an archive, get it at.

…某个在维基百科中的功能没法在我的wiki上工作?
Wikipedia and other Wikimedia web sites use the current version of the code in development; at present, this is MediaWiki, pulled from the current development branch. 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 Download from Git
 * To check what version a Wikimedia wiki is running, as well as what extensions are installed, visit the Special:Version page for that wiki

…在Fedora上设置好权限后却得到了一个403错误?
Fedora Core enables SELinux by default. Instructions for setting SELinux permissions for MediaWiki are available.

…自动注销了?
This is probably related to cookies or session data, for example a problem with PHP's session.save_path setting. 参阅Log in problems for information.

…我的wiki在Sourceforge上不工作?

 * 参阅Manual:Installing MediaWiki on SourceForge.net.

…留着账户是个好主意?
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."

Another option is to give Admins the 'hideuser' right, and indefinitely block the user with the Hide username from edits and lists option selected.

Extension:UserMerge is also useful.

到那里获得垃圾黑名单?
The spam blacklist extension can be found in Git, just like all other officially supported extensions. For installation and configuration instructions, consult the file and extension page over here.

如何用$wgSpamRegex阻止多个字符串?
尽管$wgSpamRegex在过滤页面内容方面非常强大，在正则表达式里添加多个项目可能把事情弄得很糟糕. 请考虑使用下面的方法： 这段代码范例很方便的在正则表达式里添加额外的字符串而无须每次都费时费力再做调整. 这段代码也展示其他两个很流行的屏蔽一些最常见的垃圾信息攻击的过滤器.
 * 也请参阅: Extension:SpamRegex

有没有其他的方法对抗垃圾骚扰?
参阅Manual:Combating spam 来了解像Captcha一类的反垃圾骚扰的方法.

反破坏相关
参阅Manual:Combating vandalism 获得对抗破坏的一些提示

到哪里提交bug报告和功能请求?
去 Phabricator提交Bug报告和功能请求. 参阅How to report a bug.

发生了一个奇怪的错误,我该怎么办?

 * 看看Manual:Errors_and_Symptoms 里有没有提及. 
 * 尝试寻找更多关于问题的信息，查看How to debug MediaWiki.
 * 查看下面的章节以获取关于如何联络开发者及其它知识丰富的用户的信息.

我尝试过了,但是没用.

 * 我遇到了一个问题,我发现FAQ有解决方案,也照着FAQ做了,但是没用!!!

十有八九是你没清除缓存,有一个非常简单的方法可以访问一个未缓存的页面.在你的地址栏上 的后面随便输入个标题,按下Enter键,看看会不会遇到相同的问题.

MediaWiki使用服务器端和客户端缓存,所以简单清除客户端缓存并不够.刚刚提到的清除缓存一节有指导.

或许你该检查别的:
 * 你编辑的是正确的文件吗?试着在你编辑的文件里乱写一通,有什么坏掉了吗?
 * phpinfo.php(一个只包含  的文件)是调试的好工具,把它上传到你的服务器上,打开它,查找php.ini中指定的文件位置.
 * 你有把设置放在正确的部分吗?你有在php.ini中创建重复的目录吗?记得把新的设置加到LocalSettings.php的最下面(而不是最上面!)
 * 如果你有创建 .htaccess, 请确定AllowOverrides打开了吗? 可以问问你的主机商.

有个没提到的问题,怎么办?
如果你已经仔细研究了上面的常见问题并且还是找不到答案的话，请尝试以下方法：
 * 在此网站上查看other sources of help.
 * 搜索此网站的其他内容.
 * 检索Meta里所存档的旧文档；有用的开发者文档被保留在Meta.wikimedia.org上的Pages to be exported to MediaWiki.org分类里，直到从MetaProject向MediaWiki转移完成.
 * 搜索互联网.
 * 深挖源码.
 * 查看下面的小节，了解如何联络开发人员以及其他知识丰富的用户.

运气不好,没有得到帮助咋办?

 * 在Project:Support_desk上提问.
 * 写邮件给mediawiki-l邮件列表 (也可以先搜索一下文件存档).
 * 在我们的IRC频道(Freenode网络，#mediawiki频道)里直接向开发者提问.

推荐阅读

 * 提问的智慧 注:请使用代理访问.本文含有中文版
 * 如何有效的报告BUG 注:本文含有中文版
 * 如何使用IRC频道获得有价值的帮助


 * Books about MediaWiki