Jump to navigation Jump to search
This page is a translated version of the page PHP configuration and the translation is 28% complete.

Other languages:
català • ‎dansk • ‎Deutsch • ‎English • ‎español • ‎suomi • ‎français • ‎italiano • ‎日本語 • ‎한국어 • ‎occitan • ‎polski • ‎português • ‎português do Brasil • ‎русский • ‎ไทย • ‎中文

PHP ist ein Web-Vorlagen-System, das zufällig zu einer ziemlich vollständigen Programmiersprache herangewachsen ist. PHPs Syntax, Fähigkeiten und seine Ausführungsmodell haben Ähnlichkeiten mit Perl: Skripte werden von einem Interpreter geladen, in Bytecode übersetzt und dann ausgeführt. Der PHP-Interpreter kann aus einer Befehlszeile, über CGI, oder - am häufigsten - prozessintern als Apachemodul gestartet werden.


Um die Liste von möglichen PHP-Versionen, die du mit deiner Version von MediaWiki verwenden kannst, anzuzeigen, klicke hier.


Bitte lies

Optionen zur Übersetzungszeit


Die folgenden Erweiterungen werden von MediaWiki benötigt:

MySQL und PostgreSQL über PDO werden nicht unterstützt

Perl-kompatible reguläre Ausdrücke, Sitzungen, die Standard-PHP-Bibliothek und JSON sind von Anfang an aktiviert; Perl-kompatible reguläre Ausdrücke und die Standard-PHP-Bibliothek können ab PHP 5.3 nicht mehr deaktiviert werden.


MediWiki braucht eine bestimmte Menge optionaler Funktionen von PHP, die zur Übersetzungszeit aktiviert sein müssen:


We are successfully working with these compiler options:

'./configure' \
  '--with-mysql' \
  '--with-apxs2=/usr/sbin/apxs2' \
  '--with-zlib' \
  '--with-ldap' \
  '--with-gd' \
  '--with-jpeg-dir' \
  '--with-iconv-dir' \

In detail, these configure options do the following:

Allows PHP to query MySQL. This is an essential feature (I think). You will need to have MySQL installed to enable this option.
this is required if you want to build mod_php. APXS is for configuring compilation of an Apache module. You will need to change (or omit the path) for your specific system.
Allows PHP to read / write zipped files and send compressed data to Apache ... or something like that
Important if you want your wiki users to be verified by LDAP
Use this if you want image processing 'within' PHP, else you can use ImageMagick. Because this option requires that you have various libraries installed... but presumably IM has the same deps... oh well...
Seems nonsensical
Seems nonsensical
Allows multibyte character string support. This is optional, as slower custom code will be used if not available.

Opcode caching

See Manual:Performance tuningManual:Performance tuning

Due to MediaWiki's large codebase, it is highly recommended that a system be used to cache the compiled scripts; there are a number of such plugins for PHP, some free, some proprietary. There is a list of some caches:

Fortunately, these all seem to be easy to install as Zend plugins, you just drop in a library and change your php.ini. No fussy recompiling of the entire PHP!

Depending on the cache and options used, you may have to perform a special operation whenever updating script files.

MediaWiki can also interact with that caches and use them for object caching, see $wgMainCacheTypeManual:$wgMainCacheType.

Runtime configuration (php.ini)

Some settings in php.ini affects MediaWiki behavior and some of them are incompatible with MediaWiki

Warnung Warnung: Enabling this is a major security risk and can be used for XSS attacks; MediaWiki doesn't require it, so please turn it off if you can!
Safe mode is an ill-conceived, broken-by-design setting in PHP; MediaWiki can work with this option on, but some features won't work.
This options adds quotes to data in $_GET, $_POST and $_COOKIES. MediaWiki can work with this option turned on, but will have to remove these quotes and thus will be slower.
This option corrupts data input unpredictably by adding quotes in e.g. opened files, data received from database etc. MediaWiki will refuse to install if this option is turned on.
same as magic_quotes_runtime
This option causes errors and may corrupt data unpredictably; MediaWiki will refuse to install if this option is turned on.
This option causes horrible bugs; MediaWiki will refuse to install if this option is turned on.
MediaWiki needs sufficiently memory to work. The minimal limit should be something like 20 MB, but if you want MediaWiki to work correctly, consider using at least 50 MB.
To be able to find GNU diff3 and git during installation process this entry must not contain passthru
If you are getting the error "Some parts of the edit form did not reach the server; double-check that your edits are intact and try again." then it could be because this is set with a "MB" prefix, instead of just "M" (the former is interpreted at bytes, not megabytes).

Image Resizing

ImageMagick can be used for image resizing When it is not available the GD PHP module is used instead where found.

Siehe auch