Results 1 to 5 of 5

Thread: PHP errors - preg_match_all(): Compilation failed

  1. #1
    Adrian Nabarro is offline Junior Member
    Join Date
    Feb 2012
    Posts
    6

    Question PHP errors - preg_match_all(): Compilation failed

    Hi there

    While trying to import a lot of data (about 20,000 leads) the system dies after about 100 with the following error:
    Code:
    WARNING: [2] preg_match_all( Compilation failed: unrecognized  character after (? at offset 257 on line 1799 in file  /var/www/sugar/include/utils.php
    The apache logs are full of a similar error:

    Code:
    Tue Feb 07 12:20:30 2012] [error] [client xxx.xxx.xxx.xxx] PHP Warning:  preg_match_all(): Compilation failed: unrecognized character after (? at offset 257 in /var/www/sugar/include/utils.php on line 1799
    Any ideas what might be causing these?

    Thanks in advance.

  2. #2
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Default Re: PHP errors - preg_match_all(): Compilation failed

    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

  3. #3
    Adrian Nabarro is offline Junior Member
    Join Date
    Feb 2012
    Posts
    6

    Default Re: PHP errors - preg_match_all(): Compilation failed

    Thanks kbrill!

    I did the fix recommended here:
    https://plus.google.com/u/1/10069433...ts/daZi8ppK1G9

    ... and that seemed to do the trick!

    Would you suggest revert to the original file and instead update pcre?

  4. #4
    Adrian Nabarro is offline Junior Member
    Join Date
    Feb 2012
    Posts
    6

    Default Re: PHP errors - preg_match_all(): Compilation failed

    I'd just like to add to this for anyone else having this issue.

    After updating to 6.4GA the issue returned, which suggests there IS a typo in the utils.php file.

    Thankfully, the solution is rather simple (thanks to the kind folks linked in that Google+ post):

    On line 1788 change
    Code:
    $attribute_regex        = "#\b({$jsEvents})\s*=\s*(?|(?!['\"])\S+|['\"].+?['\"])#sim";
    To

    Code:
    $attribute_regex        = "#\b({$jsEvents})\s*=\s*(?!(?!['\"])\S+|['\"].+?['\"])#sim";
    Basically, change ?| (pipe) to ?!. Hope that helps!

  5. #5
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Default Re: PHP errors - preg_match_all(): Compilation failed

    I will ask our engineering department about this and submit a bug if they agree.
    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Failed upgrade from 6.1.x to 6.2.3 - Query Failed
    By kdmp in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2011-09-29, 03:22 PM
  2. Errors Installing Community. Data base creation errors
    By alcamie in forum Installation and Upgrade Help
    Replies: 4
    Last Post: 2009-07-17, 03:56 AM
  3. Preg_Match_All help needed
    By amarasatish in forum Help
    Replies: 0
    Last Post: 2009-06-23, 01:15 PM
  4. Replies: 2
    Last Post: 2007-12-04, 12:06 AM
  5. PHP Compilation options
    By magicbobeto in forum Help
    Replies: 1
    Last Post: 2007-01-26, 02:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •