3

Trying to deploy a Kohana based project in CentOS 5. Installed PHP 5.3.1 but still getting the following error.

Warning: preg_match() [function.preg-match]: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0 in /usr/local/apache2/htdocs/icarus/system/core/utf8.php on line 30

Fatal error: PCRE has not been compiled with UTF-8 support. See PCRE Pattern Modifiers for more information. This application cannot be run without UTF-8 support. in /usr/local/apache2/htdocs/icarus/system/core/utf8.php on line 38

Trying since last 2 days, i upgraded my PHP from 5.1 to 5.3 but still getting the same error.The problem as per me is that the PCRE module of PHP in phpinfo() says is of sep 2004. Below is the actual line

PCRE Library Version    5.0 13-Sep-2004 

Can anyone tell me how to upgrade it or wats the solution to the problem.

Thanks.

  • 2
    see http://serverfault.com/questions/104873/pcre-isnt-utf8-enabled – Zypher Jan 24 '10 at 01:21
  • I have already tried the link above. Didnt help. –  Jan 24 '10 at 10:36
  • Did you follow the link in the above linked ServerFault question ? http://gaarai.com/2009/01/31/unicode-support-on-centos-52-with-php-and-pcre/ This guy has compiled an rpm of PCRE with Unicode support. All you need to do is download it and install it. Once you have done that, the output in phpinfo() will change. – Ladadadada Jan 31 '10 at 18:51
  • Why did you not just upgrade PHP as described here?: http://wiki.centos.org/HowTos/PHP_5.1_To_5.2 – Raffael Luthiger Nov 02 '11 at 23:31

3 Answers3

1

I recompiled PCRE for my system to include PCRE UTF-8

We use PHP 5.2.6 atm, however whats causing Kohana to fail is the pcre rpm.

[root@v1e-web1 files]# cat /etc/redhat-release
CentOS release 5.4 (Final)

[root@v1e-web1 files]# uname -a
Linux v1e-web1 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009 i686 i686 i386 GNU/Linux

http://digirev.us/files/RPMS/pcre/

Maybe those files will help.

grufftech
  • 6,620
  • 4
  • 35
  • 37
  • Kohana (atleast recent verisons) need PHP 5.2.6+ and PCRE installed with UTF-8 / Unicode Support, as Zypher linked above. My link is for the 386 verison of the RPM, compiled on CentOS 5.4 final. – grufftech Jan 27 '10 at 22:41
1

Another option - other then upgrading the PHP version on your CentOS 5 install (which is painful as you've seen), is to use my build of Kohana for CentOS 5 (regardless of what the text says - the repository is kept up to date with the current version being the current Kohana stable 3.0.8 version).

The Kohana software stack is patched in this distribution to work out-of-the-box on vanilla CentOS 5 with PHP 5.1.6. There is almost no loss of functionality (the main issue is error reporting that PHP 5.1 is not that good with) and its tested extensively as it is used by several different people in running different applications.

Guss
  • 2,520
  • 5
  • 32
  • 55
1

No way to solve this with original Centos 5 packages.

It's not a problem, it's a feature.

You need to re-compile and upgrade packages, or use another repository, like remi or EPEL.

Try to use EPEL only at first, it comes with php 5.3 as php-53*: yum remove php;yum install php53

Then ADD REMI repo, it comes with php 5.4 as php-*: yum remove php53;yum install php

GioMac
  • 4,444
  • 3
  • 24
  • 41