Support » Plugins and Hacks » NextGEN Gallery - WordPress Gallery Plugin » [Resolved] preg_match() [function.preg-match]: Compilation failed

[Resolved] preg_match() [function.preg-match]: Compilation failed

  • Dear all,

    I just installed a fresh WordPress and added NextGen gallery (v2.0). I have permalink enabled (day and name). On activation I got the following error:

    Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 5 in /…/public_html/bla-bla-bla.com/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.routing_app.php on line 484

    Any ideas how on fix?

    p.s. This WP uses an AddOn domain connected to the same hosting as my other, main WP site. WP sits in root of this domain which points to /public_html/bla-bla-bla.com. This is NOT a multisite setup, two installation are not related at all.

    p/s/ The main WP site uses NextGen (1.9.xx) for quite a while and I never experienced problems there. It might be related to 2.0 major update.

    p/p/s/ changing to default theme does not change anything.
    Installed plugins:
    All In One SEO Pack
    NextGEN Gallery by Photocrati
    Wysija Newsletters


Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author photocrati


    @davydov-denis – Not sure off hand what trigger this. I’m getting your error to our developers to see if they can tell the issue from the error. We’ve seen some plugin conflicts, but offhand, that seems like a safe list of plugins.

    We’ll get back to you when the developers have a chance to look at this.


    Plugin Author photocrati


    Hi again – developers asked if you might be willing to share login credentials for your site? Ideal would be both FTP and WP login. If not, that’s OK. But it would help us resolve the issue.

    You can submit them via our bug report form and they’ll go right to tech support and our developers. Be sure to say we asked for your credentials.




    I’ve looked into this issue and believe that it has to do with PHP 5.2.1 and earlier. We’re working on a fix, but in the meanwhile perhaps you could contact your hosting provider and ask them if it’s possible to configure your site to run with a later version of the PHP interpreter.

    For hosting providers that offer CPANEL, you can usually change this yourself from CPANEL by clicking on the “PHP Config” icon.

    We’re sorry for the inconvenience.


    Exactly the same error here. Disabled all other plugins: no effect, the error is still there. Switched Permalink to standard: no effect. PHP-Version is 5.3.8

    Thanks for your replies.
    Sorry, Erick, but i don’t feel like sharing loging data. Instead i would try to provide as much info as i can.

    @mweichert, i actually have PHP 5.2 at the moment. A switch to 5.3. did the trick for me.

    Plugin Author photocrati


    @davydov: Can you confirm that switching PHP versions resolved this for you?

    @col: sounds like you are still getting the same on 5.3.8, so I’ll let Mike know.

    @photocrati: yes, it works fine for me. I did not yet test the library fully (just started a new blog), but at least i don’t get the error I had before (even without any images).

    p.s. here are details of my current PHP (as shown by NextGen):

    PHP Version : 5.3.27
    PHP Safe Mode : Off
    PHP Allow URL fopen : On
    PHP Memory Limit : 512
    PHP Max Upload Size : 128M
    PHP Max Post Size : 128M
    PCRE Backtracking Limit : 500000
    PHP Max Script Execute Time : 30s
    PHP Exif support : Yes ( V1.4 )
    PHP IPTC support : Yes
    PHP XML support : Yes


    I’ve created a hotfix for users experiencing the preg_match() issue. Please deactivate and delete the NextGEN Gallery plugin from your website, and download, install, and activate this version.

    Please let us know if this hotfix resolves the issue.


    It works for me! Just installed the hotfix and the error is gone. Thank you very much! No i ´m waiting for the stable version.

    Update: changing the lightbox effects to anything other then “Fancybox” causes a new error:

    Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 4 in /home/www/web97/html/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/mixin.url_manipulation.php on line 154

    Thanks for the report, Col. I’ve prepared a new hotfix release for that issue.

    If you’d be so kind to report back if this works, I’d very much appreciate it.


    And the next error. Changing lightbox effect causes this one:

    Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 21 in /home/www/web97/html/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/mixin.url_manipulation.php on line 154

    Plugin Author photocrati


    Hi all,

    We think we may have a solution for this error. We’re moving rapidly towards an update for next week, but for those comfortable with refreshing plugin files via FTP, we have a new beta available for install. As a reminder, please DO NOT delete NextGEN Gallery to install this beta, deleting the plugin through the WP Dashboard will delete your galleries permanently!

    IT’S A BETA. Please keep in mind it’s a beta. It should resolve some issues, it won’t resolve some others, and there’s a marginal chance it may create some new ones.


    Feel free to post feedback about the beta here. If you do update to the beta and post a new thread or submit a bug report, please let us know which version you are using.

    We’ll be updating the version numbers with each new beta. It’s currently 2.0.2. For the public release we’ll just bump it up one more number from the last beta so everyone will be able to auto-update from the dashboard if they choose to.



    Hi. I am running NextGEN Gallery 2.0.7 with PHP 5.3.3 and still get the following errors when I try to insert a gallery into a post:

    Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (?< at offset 28 in /var/www/vhosts/jenal.org/httpdocs/private/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.routing_app.php on line 212

    Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (?< at offset 35 in /var/www/vhosts/jenal.org/httpdocs/private/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/class.routing_app.php on line 212

    Anything I can do?

    I also still have problems. Upgraded to 2.0.7 and also just installed the latest beta.


    Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 21 in /var/www/vhosts/ustafeltennis.nl/httpdocs/wp/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/mixin.url_manipulation.php on line 154

    PHP Version : 5.3.10

    I still got this error:

    Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 19 (...)/nextgen-gallery/products/photocrati_nextgen/modules/router/mixin.url_manipulation.php on line 161

    PHP Version : 5.2.13
    MYSQL Version : 5.5.31
    Nextgen Version: Version 2.0.31
    WordPress: 3.61

    What can I do about it? Thank you.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Resolved] preg_match() [function.preg-match]: Compilation failed’ is closed to new replies.
Skip to toolbar