User:Mikelietz/New Habari, Old PCRE

From Habari Project

Jump to: navigation, search

If you are unable to install Habari because of the following error:

Unicode support needed...

Habari requires PHP's PCRE extension to have Unicode support enabled. Please contact your web hosting provider if you do not have access to your server.

Or you are seeing lines in your log such as these:

Warning: preg_replace() [function.preg-replace]: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in system/classes/utils.php line 614

The culprit is likely an old, or badly configured, version of PHP's PCRE extension. The good news is that Habari can be coerced into working, albeit in a slightly hobbled state.

Patching Habari release 0.6

For 0.6 (the release version, not SVN) you can use these: 0.6 class files. Unzip it and place the files in /user/classes and you're good to go, for both everyday usage and new installations.

Patching trunk versions

The SVN version changes too frequently to maintain a similar download. Fortunately it's easy to patch the files yourself.

Note this is merely what works for me, and is not a recommended method. You're better off using a hosting provider with a properly configured and updated setup.

1. Create a symlink in your user/classes directory. It'll save some time.

$ ln -s ../../system/classes/ sys

2. Copy the classes that use PCRE from /system/classes/ to user/classes. If you made the symlink above, it's as easy as:

$ cp sys/utils.php .
$ cp sys/posts.php .
$ cp sys/comments.php .
$ cp sys/feedbackhandler.php .
$ cp sys/installhandler.php .
Personal tools