• Hey guys.
    Whenever i try to use any other permalink form besides the default one i get losts of errors like this:

    Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (? or (?- at offset 3 in /home/littleco/public_html/wp-includes/class-wp.php on line 204
    
    Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (? or (?- at offset 3 in /home/littleco/public_html/wp-includes/class-wp.php on line 205
    
    Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 1 in /home/littleco/public_html/wp-includes/class-wp.php on line 204

    any idea whats causing it ?

    PHP info page here: http://www.littlebuildingco.com/info.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • hi
    could you plz explain how you solved this?
    i do have the same problem and it only occurs, if i enable wp-ecommerce. drives me nuts. php and pcre are pretty much up to date (php: 5.4.9, pcre: 8.31 2012-07-06). saw that you mentioned pcre in the wpsc forum.
    thanks!

    Thread Starter Mihai Joldis

    (@misulicus)

    At the moment the only option was to hide the PHP warning messages in htaccess.

    But this is not a WPEC issue its something related to each hosting account

    Hi!

    Having the same issue and after some googling, there’s always a fix. The error seems to come from a regexp library on Apache server and versions 5.2x of PHP. It seems WPSC (and possibly other plugins) may use a more modern regular expressions library/search than is allowed.

    It sucks to have hundreds of google links point at your friendly urls, but you get dead pages… so I found this thread with a very temporary fix: http://wordpress.org/support/topic/upgraded-wordpress-to-36-next-gen-gallery-no-longer-workds

    In short, you could open your wp-includes/class-wp.php and on line 204 and 205 insert a “@” to turn off the regex error messages.
    Original code:

    if ( preg_match("#^$match#", $request_match, $matches) ||
    preg_match("#^$match#", urldecode($request_match), $matches) ) {

    New code:

    if ( @preg_match("#^$match#", $request_match, $matches) ||
    @preg_match("#^$match#", urldecode($request_match), $matches) ) {

    This fix won’t brake things that work, but you probably shouldn’t develop a plugin using it.

    To really solve the problem, you should upgrade PHP to the latest version, but I know, your host sucks and won’t answer your requests, so don’t be a victim, change host!

    All the best,
    T

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘permalinks issue Warning: preg_match()’ is closed to new replies.