Jump to content

Manual:Common errors and symptoms/PCRE

From mediawiki.org

PCRE is a Perl Compatible Regular Expressions library that comes bundled with PHP. When you try to install or upgrade to MediaWiki 1.22 or later, you may receive the following error message:

Fatal: PCRE newer version or later is required. Your PHP binary is linked with version older version.

This issue may occur if you are using an older Linux distribution (one having an older version of PCRE than that bundled with PHP) and PHP is compiled with the --with-pcre-regex=DIR configure option. In particular, the php53 packages from Red Hat Enterprise Linux 5 (and derivatives such as CentOS and Scientific Linux) are broken in this regard. MediaWiki uses features introduced in the newer version of PCRE and no longer works with older versions of the library.

Below are several methods to upgrade the PCRE library your PHP installation uses.

Selecting a newer PHP package

[edit]

Some servers will allow you to select an alternative (later) version of PHP to use with one or more domains, that includes a later version of PCRE. For example, servers running Plesk 11.5+, let you select a domain, and change the hosting to use a fastCGI version of PHP (if none are available, your hosting company may install them). While the server default PHP 5.3.3 is packaged with PCRE 6.6, selecting fastCGI PHP 5.4.25 includes PCRE 8.1

Installing newer PHP packages

[edit]

For Red Hat Enterprise Linux 5 and its derivatives, there are several third-party package repositories that have newer versions of PHP compiled without the option in question. Here are some of them:

Note that these packages are not supported by Red Hat, by any other Linux vendor, or by the MediaWiki developers.

Recompiling PHP from source

[edit]

If you compiled PHP yourself using the source code from php.net, you should be able to recompile it to use the newer, bundled version of PCRE:

  • Run ./configure again without the --with-pcre-regex=DIR option
  • Run make and/or make install again