It's better when it's simple

User Tools

Site Tools


PHP Configuration for DokuWiki

DokuWiki will run out of the box on nearly every PHP installation and the installer will check that the minimum of needed PHP functionality is available.

This page gives hints on how to tune PHP settings to influence the functionality, performance, security and portability of DokuWiki.

Please consult the online PHP manual for more details.

PHP extensions

Below you can find which extensions should be enabled for your PHP setup. On some systems these extension might need to be installed separately, other systems might bundle them in a single install package and only need them to be enabled in php.ini


These extensions are usually enabled by default anyway.

  • json – JSON decoding, encoding
  • pcre – Regular expression handling
  • session – Session handling
  • bz2 – compression handling for attic files, plugin installs
  • zlib – compression handling for attic files, plugin installs
  • mbstring – faster UTF-8 handling
  • openssl – SSL/TLS connections, used for plugin downloading
  • gd – image resizing
  • intl – internationalization handling, for example for locale aware sorting

special use cases

The following extensions are often used by plugins and thus might come in handy.

  • pdo_sqlite – used by the sqlite plugin
  • xml


The basic means of configuring PHP is via a configuration file (php.ini).

For the server module versions of PHP, this file is loaded only once when the web server is started. For the CGI and CLI version, it happens on every invocation.

This file contains a list of directives that control the way that PHP functions. You can see the online php.ini directives page for a detailed reference of those directives.

While in most cases, DokuWiki will operate “out-of-the-box” with typical distribution PHP settings, a number of configuration options has particular importance to DokuWiki.

On the other hand, always be warned that what may be a good or even suggested value for DokuWiki might in some cases break other PHP applications you also host. This is especially true when enabling directives that enhance PHP security while having other PHP applications that rely on insecure features of PHP like register_globals etc.


Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.

DokuWiki will run with short_open_tag set to off.

  • Suggested: short_open_tag = Off

However, note that some templates or plugins might rely on this feature being set to On.


Output buffering allows you to send header lines (including cookies) even after you send body content. DokuWiki will run with either setting.

  • Suggested: output_buffering = Off


Redirect all the output of all scripts to a function. Setting output_handler automatically turns on output_buffering.

This setting can be used to automatically gzip all content before sending it to the client's browser. This can create problems with images and downloads. Turn on DokuWiki's gzip_output feature instead.

  • Suggested: output_handler =


Provides transparent output compression using the zlib library. In general setting zlib.output_compression = On works quite well with DokuWiki.

However, DokuWiki supports output compression via the gzip_output option.

  • Suggested: zlib.output_compression = Off


Tells PHP to tell the output layer to flush itself automatically after every output block. Turning this option on has serious performance implications and is generally recommended for debugging purposes only. DokuWiki takes care of flushing the buffer when needed.

  • Suggested: implicit_flush = Off


Whether to warn when arguments are passed by reference at function call time, as this method is deprecated. Arguments that should be passed by reference should be indicated in the function declaration, not at function call time.

  • Suggested: allow_call_time_pass_reference = Off


Maximum execution time of each script, in seconds.

  • Suggested: max_execution_time = 30


Maximum amount of time each script may spend parsing request data.

  • Suggested: max_input_time = 60


Under certain conditions (e.g.- working with large tables with the edittable plugin) the default value of 1000 is quickly met.

  • Suggested: max_input_vars = 10000


Maximum amount of memory a script may consume.

  • Suggested: memory_limit = 128M


Which errors to report.

  • Suggested: error_reporting = E_ALL & ~E_NOTICE


Print out errors (as a part of the output). For production web sites, you're strongly encouraged to turn this feature off, and use error logging instead.

  • Suggested: display_errors = Off


Print out errors that occur during PHP's startup sequence (display_errors has no control over these). It's strongly recommended to keep display_startup_errors off, except for when debugging.

  • Suggested: display_startup_errors = Off


Log errors into a log file. Also set error_log accordingly.

  • Suggested: log_errors = On


The order in which PHP registers GET, POST, Cookie, Environment and Built-in variables (G, P, C, E & S respectively).

  • Suggested: variables_order = “EGPCS”


Whether to declare the argv & argc variables (that would contain the GET information).

  • Suggested: register_argc_argv = Off


Whether to allow HTTP file uploads.

  • Suggested: file_uploads = On


Maximum allowed size for uploaded files. It should match what you expect the maximum size of uploaded mediafiles to be.


Whether to use cookies.

  • Suggested: session.use_cookies = 1


Defines which cache control HTTP headers are sent to the client. These headers determine the rules by which the page content may be cached by the client and intermediate proxies. Acceptable values are none, nocache (the default), private, private_no_expire or public.Setting the cache limiter to nocache disallows any client/proxy caching. A value of public permits caching by proxies and the client, whereas private disallows caching by proxies and permits the client to cache the contents. In private mode, the Expire header sent to the client may cause confusion for some browsers, including Mozilla. You can avoid this problem by using private_no_expire mode. The expire header is never sent to the client in this mode.

In case of caching problems (i.e. you edit a page but the changes do not appear when viewing that page) you can try setting: session.cache_limiter = nocache


Dynamic Extensions. See PHP extensions above for recommendations.

install/php.txt · Last modified: 2023-09-19 13:35 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki