Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Hosting Requirements /

What you need to consider when choosing a hosting provider and plan.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Error on version 3.1 preg_match_all() in ShortcodeParser.php


Go to End


9 Posts   4438 Views

Avatar
thepleb

Community Member, 22 Posts

17 January 2015 at 12:34am

I am using a hosting provider who is currently running version 6.6 of PCRE and have no plans currently to upgrade it. As a result I receive a preg_match_all() error when I try to load a page.

I can suppress the error by turning off Dev mode, but that doesn't solve the problem because the links inside a HTML content do not resolve to a URLSegment.

Does anyone know what I can either do to the ShortcodeParser.php file to sort the error or to the TinyMCE editor to stop it putting shortcodes in, therefore removing the need for the parser?

Avatar
martimiz

Forum Moderator, 1391 Posts

22 January 2015 at 2:04am

Sorry for the late respons, could you post the complete error message you are getting?

Avatar
Mizar

Community Member, 2 Posts

29 January 2015 at 11:53pm

Edited: 29/01/2015 11:56pm

I have the same problem.
I've attached a screenshot of the error.
Is there a version of silverstripe that can run with pcre 6.6?

Thanks

Attached Files
Avatar
martimiz

Forum Moderator, 1391 Posts

30 January 2015 at 12:58am

I'd really think hard about changing hosting providers, if your current provider doesn't want to at least provide a relatively 'modern' setup for the modern framework that is SilverStripe 3.1.

Because you might go and remove the (need for the) shortcode parser and thus remove a big part of SilverStripes link management. Or better you could even write your own shortcodeparser, but you will still run into problems when using functions or (custom) modules that use preg_match in some similar way...

At least that's what I would do...

Avatar
thepleb

Community Member, 22 Posts

30 January 2015 at 11:23pm

Yes, that is exactly the same error I get. It restricts short codes in the content, but also, it transpires, it stops me creating new pages or re-ordering pages in the CMS.

Currently I have to make the changes in my local copy and then upload the database to the hosting provider to make the changes live. This is working for us at the moment, because I am the only person making changes as the site is still quite new.

Unfortunately we have just signed with them for 2 years, so I have to make this work the best we can.

Avatar
martimiz

Forum Moderator, 1391 Posts

31 January 2015 at 1:56am

Edited: 31/01/2015 1:58am

OK - you're really in a fix then... I would keep demanding them to upgrade though!

It looks like the problem lies in (?< - Google shows lots of people seem to have experienced this at some time... (https://bugs.php.net/bug.php?id=46904&edit=3)

I can't reproduce this because I have no PCRE 6.6 available, but if this bugfix is true, you could try that out by finding framework/parsers/ShortCodeParser.php, and replace all of the instances of (?< by (?P< in the private static $tagrx

If, by chance, that works, there are be ways to implement this without changing core code... But even then I don't know where other snags like this might live...

Avatar
Mizar

Community Member, 2 Posts

31 January 2015 at 6:55am

Thanks martimiz!!!!
I have replaced all the instances of (?< and now the warning on the file ShortCodeParser.php disappear.

Now the warning is on the Requirements.php (see the attached file). Any ideas?? I still cannot create new pages :(

Thanks

Avatar
martimiz

Forum Moderator, 1391 Posts

31 January 2015 at 10:40am

I suppose that's final then - SilverStripe really isn't compatible with PCRE 6. It really is just too old (I think it dates from the early PHP 5.2 versions?)

Sorry I can't help you, they definitely do need to update...

Go to Top