It's better when it's simple




這份翻譯較原始頁面舊,可能已過時。 檢視變更

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community

Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy


currently translating FIXME


DokuWiki 大部份的功能都可以透過各種設定選項調整。最簡單的方式是使用設定管理員來修改這些選項。

這個頁面描述了全部可改變的設定及它們可能的值。全部的預設值都存在 conf/dokuwiki.php 中。如果你想要修改設定你應該修改 conf/local.php – 這麼做可以確保你的自訂設定不會被下一次的升級蓋過。設定管理員也會使用這個檔案。

以下是一個簡單的 conf/local.php

$conf['title']     = "Admin's Wiki";
$conf['useacl']    = 1;
$conf['superuser'] = 'admin';

關於設定檔,有些地方要注意的:這個檔案是一小部份的 PHP 程式碼,所以必須以 PHP 語法保存。例如:每一行的結尾必須有個分號。而變數有下列型態:

  • 數字可以直接輸入。 如: 9
  • 字串必須用單引號或雙引號(英式)包裹。如: 'foo bar'
  • 布林值可以是 truefalse10
  • 陣列包含上列其中一種型態的多個值
:!: 這是文件頁 :!:
​改變這裡並不會改變 Wiki 設定!請在改進文件時才編輯此頁!


title (標題)

這是你 WIki 的名字。你可以任意的改變它。如果你想要在同一個伺服器上安裝多個 DokuWiki,你必須給它們不同的標題!

  • 型態:Unicode 字串
  • 預設: DokuWiki

start (開始)

這是每個 namespace (包含根名稱空間(root namespace))的預設頁面名稱。如果沒有輸入頁面的話,這個頁面會被讀取。也就是我們常說的「首頁」。 ;-)

  • 型態:字串
  • 預設: start

lang (語言)

這裡可以設定介面語言。請見 multilanguage

  • 型態:字串
  • 預設: en

template (樣式)

這是你 DokuWiki 樣式的名稱。更多的資訊請見樣版

  • 型態:字串
  • 預設: default

savedir (儲存的目錄)


  • 型態:字串
  • 預設: ./data


參數 預設的次目錄
資料資料夾 pages
舊版資料夾 attic
多媒體資料夾 media
快取資料夾 cache
鎖定資料夾 locks
改變記錄 changes.log
meta 資料夾 meta

basedir (基礎目錄)

通常 DokuWiki 可以自行偵測它所安裝的目錄,但有時候會因為某些原因而無法達成。如果 DokuWiki 無法正確的運作及無法找到如圖片等網頁物件,你可以在這裡設定目錄。

你在這裡設定的路徑是從伺服器的根目錄到 DokuWiki 的安裝目錄。例如:如果你的 Wiki 在 ,你應該將基礎目錄設為 /dokuwiki/ 。請確定開頭有個 “/“。

  • 型態:字串
  • 預設:/

baseurl (基礎路徑)

URL to server including protocol - 留白會自動偵測

你在這裡設定的是伺服器的根目錄。例如,如果你的 Wiki 在,你應該將基礎路徑設為,結尾不含 ”/“。

  • 型態:字串
  • 預設:

註:':port' 部份只在伺服器不在標準的 port 下(也就是不是 80 port)運作有用。如果你使用標準 port ,你可以忽略這個部份。

dmode (資料夾權限)

This option sets the permissions you want your directories to be created with. What you set here is the mode to set on your directories in octal (not a string, but a number always starting with 0). The default creates directories with unix permissions of 0755 (rwxr-xr-x, see fmode below for an explanation).

  • Type: Number
  • Default: 0755

This setting has no effect on Windows servers. Be sure to read the pages on permissions and security.

fmode (檔案權限)

This option sets the permissions you want your files to be created with. What you set here is the mode to set on your files in octal (not a string, but a number always starting with 0). The default creates files with unix permissions of 0644 (rw-r–r–).

  • Type: Number
  • Default: 0644

This setting has no effect on Windows servers. Be sure to read the pages on permissions and security.

The first non-zero digit (6 in the default above) determines the user permissions (ie. permissions of the file owner), second non-zero digit is the group permissions and the last digit is permissions for other (ie. everyone else). To convert permissions into the correct number, use the following key:

  • Read=4
  • Write=2
  • Execute=1

and sum the result for each one of the above groups. Thus, if you want read and write permissions for the user owning the files, specify 4+2=6 as the first non-zero digit. If you would want read and execute permissions (appropriate eg. for directories) for the group that the file belongs to, specify 4+1=5 as the second non-zero digit. The default permission value above is interpreted as read and write permissions for the user and only read permissions (number 4) for the group and others.

allowdebug 允許除蟲

To make it simpler to answer support requests, DokuWiki can output a huge list of debug strings when requested. For that, just append ”&do=debug”, without the “ characters, to the URL, as in,


This is useful to troubleshoot all kind of configuration problems when setting up the Wiki for the first time. But it reveals a lot of info about the server DokuWiki is running on as well.

:!: To be on the safe side you should disable this option and thus disabling the debug function right after your Wiki was set up successfully. (See the page about security.)

  • Type: Boolean
  • Default: 0

Display options(顯示選項)

recent (最近)

Defines the number of documents per page to show in the Recent changes; the default number items to return in XML syndication of recent changes; and the number of items to return in XML syndication of the list of documents.

  • Type: Number
  • Default: 20

Defines the number of recently visited pages to show in the breadcrumbs trail. Set to 0 to disable it.

  • Type: Number
  • Default: 10


This option enables an alternative kind of breadcrumbs displaying the hierarchy of namespaces a page is in. You may want to disable the standard breadcrumbs if you use this feature.

  • Type: Boolean
  • Default: 0


Enable this to see the full filesystem path of the displayed document.

  • Type: boolean
  • Default: 0


Enable to convert certain character combinations to their typographically correct counterpart.

  • Type: Boolean
  • Default: 1


Configures how dates are formatted. This is directly passed to the strftime PHP function. Some people may prefer to set it to %d.%m.%Y %H:%i.

  • Type : String
  • Default : %Y/%m/%d %H:%M



@USER@ 使用者的登入帳號
@NAME@ 使用者的全名
@MAIL@ 使用者的e-mail
@DATE@ 目前的日期、時間,格式參考前述dformat
  • Type: String
  • Default: --- //[[@MAIL@|@NAME@]] @DATE@//

Some people may prefer to use something shorter like: --- //[[@MAIL@|@USER@]] %b%e//. If you want to have user pages you could use something like this: --- //[[user:@USER@|@NAME@]] @DATE@//


Title level starting with and below to include in the automatically generated table of contents.

  • Type: Number (0-5)
  • Default: 1


Set this variable to the maximum number of heading levels to include in the automatically generated Table of Contents.

  • Type: Number (1-5)
  • Default: 3

A value of 0 will disable the Table of Contents.


Set this variable to the maximum number of heading levels deep to create as separate, editable, sections.

  • Type: Number (0-5)
  • Default: 3

A value of 0 will disable the in-page section editing buttons.


Enable this for CamelCase links. This is a common but controversial way of linking in Wikis. If you enable this, and later disable it again, you may create orphan pages.

  • Type: Boolean
  • Default: 0


When this is set to 1, accented chars in page names will be replaced by their unaccented ASCII equivalents. Eg. ü becomes ue or á becomes a. When set 2, romanization of pagenames is turned on: symbols from non-latin alphabets are replaced with close ASCII equivalents. Setting the value to 0 turns off this feature altogether.

  • Type: Number (0-2)
  • Default: 1


When this option is enabled, a link to a wiki page name will automatically use the first heading in the page for each of the following:

  • The title of the page, as shown in the browser or in search engine results.
  • The text for a link to the page, unless the link specification contains an explicit title.
  • The title of RSS feed entries for the page

For more information, read Using the first heading as the page name.

  • Type: Boolean
  • Default: 0


Check for references before deleting media files.

  • Type: Boolean
  • Default: 1


How many references should be shown (5 is a good value).

  • Type: Number
  • Default: 5

Authentication Options


Enable this, to use an Access Control List for restricting what the users of your wiki may do.

  • Type: Boolean
  • Default: 0


DokuWiki supports two methods of password handling after a new user has been registered. The setting of this configuration variable determines which method is used:

  1. automatically generated passwords (1)
    The user specifies his email address and DokuWiki generates a password and sends it to him. To use this method, set autopasswd to 1. (You can configure the “From” email address used for all mails sent through DokuWiki via the mailfrom setting.)
  2. user defined passwords (0)
    The registration form contains two fields where the new user can type in his desired password. No email is sent. To use this method set, autopasswd to 0.
  • Type: Boolean
  • Default: 1


This specifies which backend should be used to authenticate against.

DokuWiki supports several authentication backends. For full list see DokuWiki Manual, Chapter Authentication Methods.

  • Type: String
  • Default: plain


Passwords should always be saved as an encrypted hash. DokuWiki supports multiple hash methods, which one it should use is defined by this option. What you choose here depends on your security needs and if you want to use an existing authentication database. DokuWiki is able to determine which method was used from an encrypted password, so you can always change the used method as long as your authentication backend supports this.

When using salted hashing, a random salt is generated when the user is initially assigned a password, and each time the user changes their password. The salt is stored with the password. Whether DokuWiki is able to apply a salt depends on the authentication backend used.

The following hash methods are available:

Option Description
smd5 Salted MD5 hashing
md5 Simple MD5 hashing (this was the method used in older Releases)
sha1 SHA1 hashing
ssha Salted SHA1 hashing (as used in LDAP)
crypt Unix crypt
mysql Password as used in MySQL before Version 4.1.1
my411 Password as used in MySQL 4.1.1 or higher
  • Type: String
  • Default: smd5


If a user signs up (using openregister) he will automatically be added to this group.

  • Type : String
  • Default: user


Specifies who has superuser rights in DokuWiki. Superusers always have all permissions regardless of ACL restrictions and are allowed to edit ACL restrictions (think root).

You can set either a username or the name of a group by prepending an @ char to the groupname.

  • Type: String
  • Default: !!not set!!

Note: in the current release you need to encode most special chars in the user or groupname using the following table:

Doesn't seem to be the case anymore. Example: @wiki%5fwrite got re-encoded to @wiki%255fwrite.
Space %20 ! %21 %22 # %23 $ %24 % %25 & %26 ' %27 ( %28 ) %29 * %2a
+ %2b , %2c - %2d . %2e / %2f : %3a ; %3b < %3c = %3d > %3e ? %3f
@ %40 [ %5b \ %5c ] %5d ^ %5e _ %5f ` %60 { %7b | %7c } %7d ~ %7e

Example: If the username is then you need to set the option to admin%40foo%2ebar. Do not encode the starting @ for groups.


Disable some ''?do=something'' commands

  • Type: string
  • Default: ""

For example, if you are using some indexmenu plugin, you can disable default index of all pages by setting $conf['disableactions']=“index”;

For a list of all actions, use the Configuration Manager plugin.


Specifies who has manager rights in DokuWiki. Managers gain access to the a limited selection of items on the admin menu. e.g. the Revert Manager.

You can set either a username or the name of a group by prepending an @ char to the groupname.

  • Type: String
  • Default: !!not set!!


Require a user to confirm their current password when updating their DokuWiki user profile.

  • Type: Boolean
  • Default: 1


When enabled, namespaces for which a user has no read permissions will not be shown in the namespace index. This may break the index view when deeper namespaces have higher permissions than the ones above (which is usually the case). Not recommended except for paranoid people ;-).

  • Type: Boolean
  • Default: 0

Antispam features


Enables the use of a blacklist against WikiSpam.

  • Type: Boolean
  • Default: 1


Use rel=“nofollow” for external links like this <a rel=“nofollow” …>.
More info on nofollow here and a different perspective here.

  • Type: Boolean
  • Default: 1


When creating/modifying a page allow search engines to index it after this time (in seconds). This works by adding <meta name=“robots” content=“noindex,follow” /> in the output if the specified time hasn't elapsed.

  • Type: Number
  • Default: 60*60*24*5 (i.e. five days)


This configures if and how email addresses will be obfuscated against harvesting bots. Possible options are:

  • visible – replaces @ with [at], . with [dot] and - with [dash]
  • hex – uses hex entities to encode the address
  • none – no obfuscating is used
  • Type: String
  • Default: hex


This option protects your wiki against uploading HTML through the media manager even when hidden in other non-HTML files. This is a counter measure against a bug in Microsoft Internet Explorer.

  • Type: Boolean
  • Default: 1

Editing Settings


Enable auto draft saving.

  • Type: Boolean
  • Default: 1


Defines if embedding HTML using the <html> tags is allowed. This may break the layout and XHTML compliance if wrong HTML is inserted. :!: This is a security problem when used on a freely accessible site!

  • Type: Boolean
  • Default: 0


Defines if embedding PHP using the <php> tags is allowed. :!: This is a huge security problem when used on a freely accessible site!

  • Type: Boolean
  • Default: 0


This option may contain an email address to which notifications about page adds and changes will be sent. No mails are sent when this is a blank string. To add more than one email address, use the comma to separate the entries (','). (You can configure the “From” email address used for all mails sent through DokuWiki via the mailfrom setting.)

  • Type: String
  • Default:


When set to an email address, notification mails will be sent to this address whenever a new user registers at the wiki.

  • Type: String
  • Default:


Enables email notifications of changes to a specific page (similar to the notify option). If this option is enabled there will be an additional “Subscribe Changes” button for logged in users. (You can configure the “From” email address used for all mails sent through DokuWiki via the mailfrom setting.)

  • Type: Boolean
  • Default: 1


Defines the maximum age for lockfiles in seconds. See locking.

  • Type: Number
  • Default: 15*60 (15 Minutes)


Configures the maximum age of a cached paged in seconds. See caching.

  • Type: Number
  • Default: 60*60*24 (one day)


This configures the HTML TARGET value used for different link types. The target value tells the web browser where to open the requested link. If a target is empty, then the link will open in the same window.

  • Type: Array
  • Default: All links are opened in the same browser window

Possible keys for this array are :

  • wiki
  • interwiki for interwiki links
  • extern
  • media for uploaded files.
  • windows for windows shares.

Possible values for the target attribute :

  • _blank : open the link in a new window.
  • _self or empty string : open the link in the same window.
  • Other values such as _parent or _top or framename assume you are using a template with frames, in that situation, you should know what to put in this array.

Media Settings


For resizing images DokuWiki uses PHP's libGD if available. DokuWiki tries to detect the availability and version of libGD automatically. However, in older PHP versions, this does not work. You can force a version by setting this variable. Possible values are: '0' for no libGD support; '1' for libGD version 1.x; and '2' for libGD 2 with autodetect.

  • Type: Number
  • Default: 2


By default DokuWiki uses PHP's libGD (see above) however ImageMagick's convert is more powerful but not always available. If it is installed on your server you can give its path here and DokuWiki will use it instead of libGD.

  • Type: String
  • Default:


This sets the compression quality of jpg's created when resizing images. Low values create smaller files, but can introduce jpg artifacts. The range is from 0 to 100.

  • Type: Number
  • Default: 70


Maximum size (bytes) fetch.php may download from extern. This is used to cache external images and resize them if needed. To disable this functionality completely just set this option to 0. (Setting this to 0 is suggested in the security page.)

  • Type: Number
  • Default: 0

Advanced options


Check for new release messages. See update check.

  • Type: Boolean
  • Default: 1


Enable this to use rewriting for nicer URLs. Either using the Apache mod_rewrite module or by letting DokuWiki rewrite the URLs itself-

  • Type: Number
  • Default: 0

You can set the following values:

Value Info Example URL
0 No URL rewriting is used. This is the default.
1 URL rewriting is done with an Apache module. You need to edit the .htaccess file
2 The rewriting is done by DokuWiki.

For detailed config options please refer to rewrite.


If you enabled the rewrite option above, you can use this option to use a slash instead of a colon as namespace separator in URLs.

  • Type: Boolean
  • Default: 0


This variable determines the character that separates words in a page ID and that replaces characters not valid in a page ID.

The page ID is the component of the URL that specifies the page. For example, by default the link doesn't exist goes to the URL wiki:doesn_t_exist is the page ID. The default sepchar is '_', so the apostrophe and the space each appear as an '_' in the link.

By changing sepchar to another character, you can change the '_' to another character. The valid sepchar characters are those that are valid in a page ID: letters, digits, underscore (_), dash (-), and dot (.). The sepchar variable must contain exactly one character.

Be careful with this variable. By changing it you can make pages created under a previous sepchar inaccessible. When you create a new page, the page ID becomes the file name for the page. If you create pages with sepchar '_' and then later use sepchar '-', your links to those previously created pages will break because the links will change but the file names won't.

  • Type: Character (letter, digit, '_', '-', or '.')
  • Default: _


When this is enabled, all links are created as absolute URLs in the form http://server/path. This was the default in previous releases. URLs relative to the Serverroot are now prefered.

  • Type: Boolean
  • Default: 0


This option is probably only useful in English Wikis. If set to 1, plural forms of linked pages are tried automatically when the singular form is not found (and the other way round). So pagenames and pagename would then both link automatically to the same existing page.

  • Type: Boolean
  • Default: 0


This address will be used as sender address for all mails which are sent through DokuWiki. Make sure your Mailserver accepts the address you supply here. If you leave this empty the default PHP address will be used (usually webserveruser@webserverhostname)

  • Type: String
  • Default:


Enables simple whitespace and comment stripping in CSS and JavaScript files. Don't confuse with the compression option - to avoid this confusion it is sometimes called compaction instead.

  • Type: Boolean
  • Default: 0


Pages are compressed when sending them over the network to browsers that can handle gzip or deflate content encoding. Disable this setting if compression is applied later by an external tool (such as Apache's mod_gzip).

  • Type: Boolean
  • Default: 0


This option accepts a Regular Expression to filter certain pages from all automatic listings (RSS, recent changes, search results, index). This is useful to exclude certain pages like the ones used in the sidebar templates. The regexp is matched against the full page ID with a leading colon. If it matches, the page is assumed to be a hidden one. This is a rather cosmetical option not a security one!

  • Type: String
  • Default:


When someone follows a link to a page not existing yet, DokuWiki will send a usual 200 HTTP response. In a wiki this is a wanted behaviour, however if DokuWiki is used as a CMS system one might prefer to have DokuWiki answering with a 404 “not found” response. Enabling this option will cause this behaviour. Note: this will not change what content will be sent, only the HTTP status changes.

  • Type: Boolean
  • Default: false


Determines how old page versions (attic) will be stored. The default gz uses gzip compression, setting it to bz2 will use bzip2 compression. Set to 0 to disable. Don't confuse with the compress option.

  • Type: String
  • Default: gz

Note that if you change the compression method after revisions have been created, old revisions will be inaccessible via the “Old revisions” button. To fix this, re-compress old revisions using the newly selected method, or decompress the old revisions, as appropriate.


DokuWiki can automatically generate a XML sitemap suitable for the submission to the Google search engine. The option expects a number of days configuring how often the sitemap should be recreated. The default is not to create a sitemap. See sitemap for more info.

  • Type: number
  • Default: 0


This option works around a problem on certain platform where ignore_user_abort function is broken. In fact only IIS with PHP running as CGI is known to be broken.

  • Type: boolean
  • Default: 0


Sets the default type for the created XML feed. See syndication.

  • Type: String
  • Default: 'rss1'
  • Options
    • 'rss' - RSS 0.91
    • 'rss1' - RSS 1.0
    • 'rss2' - RSS 2.0
    • 'atom' - Atom 0.3
    • 'atom1' - Atom 1.0


Sets the default link target for the created XML feed. See syndication.

  • Type: String
  • Default: 'diff'
  • Options
    • 'diff' - page showing revision differences
    • 'page' - the page as of the revision
    • 'rev' - page showing all revisions of that page
    • 'current' - most recent revision of page (which may show a more recent revision than 'page')


How often to update the RSS feed in seconds. Between updates the cached version of the RSS feed is used. An update interval of hour(s) will be sufficient for a slowly changing wiki. See syndication also.

  • Type: Number
  • Default: 60*5 (5 minutes)


Should the edit summary be added to the feed item titles? If you use DokuWiki for bloging or as CMS you probably want to disable this option.

  • Type: Boolean
  • Default: 1


How many days of recent changes should be shown in the global recent changes list?

  • Type: integer
  • Default: 7

Network Settings


Use this to configure a Web-Proxy to use for outbound connections. See proxy for details.

  • Type: Array
  • Default: no proxy is used


Enables the safemodehack - read the page for more info

  • Type: Boolean
  • Default: 0


FTP-Options for the safemodehack - read the page for more info

  • Type: Array
  • Default: not used
zh-tw/config.txt · 上一次變更: 2016-12-21 11:25 由