SEF Error: PHP regular expression limit reached

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
podvelde
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Sun May 03, 2009 9:06 pm
Location: Amsterdam
Contact:

SEF Error: PHP regular expression limit reached

Post by podvelde » Mon Dec 28, 2015 3:28 pm

On a pristine Joomla 3.4.x installation with all defaults untouched having a long article results in an error:
PHP regular expression limit reached (pcre.backtrack_limit)

The error message is generated in an error routine in the SEF system plugin on line 89; that error routine is called in the same file on line 53 (Joomla 3.4.x).

The remedy given on many forums is to increase PCRE memory size, but in my case increasing sizes in the PHP.ini file eventually resullted in the system hanging, but not displaying the long article. The final solution was to switch off SEF; it's being described, another solution would be to disable the SEF system plugin (haven't tried this myself yet).

I'm left with one big question: this appears to have been an issue with Joomla since 1.6, in other words for years, why isn't something done about it. See e.g.:
http://joomlacode.org/gf/project/joomla ... m_id=24865
According to this the issue was closed in 2013. How do you mean? The only thing that was done was adding an error routine that reports the error (resulting in the error message above) and not repairing the problem as such itself. As a result, the problem is still there in 2015.

Does all of this mean, there's a strict maximum article length in Joomla 3.4 if SEF is switched on; in that case, would it be an idea to document this maximum ?

Why would anyone want to go through a, possibly very long, article using PCRE ???

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4026
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: SEF Error: PHP regular expression limit reached

Post by itoctopus » Wed Dec 30, 2015 5:37 am

Instead of increasing the memory, trying increasing, in your php.ini, the following value:

Code: Select all

pcre.backtrack_limit
It is defaulted to 1000000 - try increasing it to, say 2000000, and see if that fixes the problem.

By the way, how big is your article?
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

podvelde
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Sun May 03, 2009 9:06 pm
Location: Amsterdam
Contact:

Re: SEF Error: PHP regular expression limit reached

Post by podvelde » Wed Dec 30, 2015 8:12 pm

itoctopus wrote:Instead of increasing the memory, trying increasing, in your php.ini, the following value:

Code: Select all

pcre.backtrack_limit
It is defaulted to 1000000 - try increasing it to, say 2000000, and see if that fixes the problem.

By the way, how big is your article?
I have articles of up to about 1,5Mb in Joomla, that's enforced by the application. It tends to work with the one exception described: the SEF Plugin.

After reading the forums, I had indeed tried increasing the limit in php.ini, but at 1500000, my system hung. That's when I started looking for the root cause and discovered the PCRE call in the plugin. Personally, I don't think this call is a very good idea, apart from it not being 100% clear to me what exactly the plugin is trying to achieve (it's examining the html text but I would like to know why and how). I got the impression e.g. the comments are not 100% in line with the code.


Locked

Return to “Joomla! 3.x Bug Reporting”