Page 1 of 1

SEF Error: PHP regular expression limit reached

Posted: Mon Dec 28, 2015 3:28 pm
by podvelde
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 ???

Re: SEF Error: PHP regular expression limit reached

Posted: Wed Dec 30, 2015 5:37 am
by itoctopus
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?

Re: SEF Error: PHP regular expression limit reached

Posted: Wed Dec 30, 2015 8:12 pm
by podvelde
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.