glossify모듈을 설치/활성화한 후의 warning: preg_replace() [function.preg-replace]: Compilation failed: support for \P, \p, and \X 경고 메시지 대처법.

glossify모듈을 설치/활성화한 후의 warning: preg_replace() [function.preg-replace]: Compilation failed: support for \P, \p, and \X 경고 메시지 대처법.

・현상 : glossify모듈을 설치/활성화한 후, 에러는 아니지만 관리자 화면에 아래와 같은 경고가 나타났다.

warning: preg_replace() [function.preg-replace]: Compilation failed: support for \P, \p, and \X has not been compiled at offset 5 in /드루팔이 설치된 디렉토리/sites/all/modules/glossify/glossify.module on line 414.

・원인 : 호스팅 OS상의 PCRE Unicode support 문제이다.

・해결 : 아래와 같이 시스템 패키지를 수정해야 한다. (루트 권한 필요.)

기존의 현상의 확인.

# pcretest -C

PCRE version 6.6 06-Feb-2006
Compiled with
  UTF-8 support
  No Unicode properties support
  Newline character is LF
  Internal link size = 2
  POSIX malloc threshold = 10
  Default match limit = 10000000
  Default recursion depth limit = 10000000
  Match recursion uses stack
 
# yum list pcre*

$ rpm -ivh –force –nodeps –replacepkgs –replacefiles http://gaarai.com/wp-content/uploads/2009/01/pcre-6.6-2.7.i386.rpm

# yum update pcre*

중간에 yes를 눌러줘야 한다.

수정된 상황을 재확인해 보면,
# pcretest -C

PCRE version 6.6 06-Feb-2006
Compiled with
  UTF-8 support
  Unicode properties support   <=== 이렇게 수정됐으면 성공.
  Newline character is LF
  Internal link size = 2
  POSIX malloc threshold = 10
  Default match limit = 10000000
  Default recursion depth limit = 10000000
  Match recursion uses stack

* 위와 같이 수정후 아파치 서버의 재기동이 필요하다.
CentOS의 경우, /sbin/service httpd restart 명령으로 재기동 가능.

・재발방지 : 특별히 필요없다. 해당 경고가 나오면 위와 같이 조치하면 된다.

* 참고 : http://drupal.org/node/1032098#comment-4025124

* Unicode Support on CentOS 5.2 with PHP and PCRE by Chris Jean
http://chrisjean.com/2009/01/31/unicode-support-on-centos-52-with-php-an...