preg_replace() error

matze_ - April 29, 2009 - 11:20
Project:Bibliography Module
Version:6.x-1.3
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,
I just updated to 6-1.3 and get the following error message in the log whenever i visit a biblio page.

preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: support for \P, \p, and \X has not been compiled at offset 7 in /var/www/virtual/ahfr/modules/biblio/biblio_theme.inc on line 392.

Can't make any sense of it. Is there something wrong with my php installation (support for \P, \p, and \X has not been compiled)? Using php 5.2.4

Many thanks,
Matze

#1

rjerome - April 29, 2009 - 12:37

What OS are you running that on?

PHP 5.2.4 should support that (see http://php.net/manual/en/regexp.reference.php#regexp.reference.unicode). It may be a an issue with how the underlying PCRE library was built.

#2

matze_ - April 29, 2009 - 13:53

The Server is running:
Mandriva Linux 2.6.22.19-desktop-2mdv #1 SMP
Apache/2.2.6 (Mandriva Linux/PREFORK-8.1mdv2008.0)

Unfortunately I have no way of changing any of that.

I had a look at the changes in biblio_theme.inc (http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/biblio/bibl... ) and noticed the changes in the unicode stuff, I see the \p and \P but have no idea what it does.

Is it the way php was compiled?

#3

rjerome - April 29, 2009 - 15:17

You might want to check out this site... http://gaarai.com/2009/01/31/unicode-support-on-centos-52-with-php-and-p... it details how diagnose and fix the issue.

#4

matze_ - April 29, 2009 - 17:20

Thank you Ron.
I'll talk to the server admin about this, won't be easy to get him to change that :-(

The site seems to be working fine, just the errors in the log.
What is my chance if i change these unicode lines back to what they were in 6-1.2? Will that work?

#5

rjerome - April 29, 2009 - 17:52

Welllll, it will eliminate the errors, but it could cause you some grief. What was there before was not for Latin-1 characters not UTF-8, and Drupal saves everything as UTF-8 so you'll likely bump into so issues at some point.

Changing the library is really not that big a deal, I did it on my CentOS server already. CentOS was not quite so crippled as Mandriva, it was just silently ignoring those expressions :-(

#6

rjerome - April 29, 2009 - 20:12

FYI, Since I have to release a new version (1.4) due to another major bug, I have added a test to see if the PCRE library can deal with UTF-8 characters and if not, it uses some alternatives. This should address your issue without having to change the libraries on the server.

I did this because, no doubt, there will be others who run into the same issue.

Ron.

#7

matze_ - April 30, 2009 - 09:55
Status:active» fixed

Thats great. Thank you very much.

#8

System Message - May 14, 2009 - 10:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.