-
2006-10-09
sept
Hi,
I hit a bug during my tests of dokuwiki-rc2006-10-08 with php5.
When saving a page I had this message :
Warning: preg_match() [function.preg-match]: Compilation failed: repeated subpattern is too long at offset 18501 in /home/sept/logidee/web/dokuwiki-rc1/inc/common.php on line 453
It is due to userwordstop processing.
I changed the line 442 of inc/common.php to the following
//read file in chunks of 200 - this should work around the
//MAX_PATTERN_SIZE in modern PCRE
$chunksize = 200;
Here the patch :
--- dokuwiki-rc2006-10-08/inc/common.php 2006-10-08 12:37:42.000000000 +0
200
+++ ../logidee/web/dokuwiki/inc/common.php 2006-10-09 14:19:53.000000000 +0
200
@@ -437,9 +437,9 @@
//this is very bad performancewise and may even be too high still
$chunksize = 40;
}else{
- //read file in chunks of 600 - this should work around the
+ //read file in chunks of 200 - this should work around the
//MAX_PATTERN_SIZE in modern PCRE
- $chunksize = 400;
+ $chunksize = 200;
}
while($blocks = array_splice($wordblocks,0,$chunksize)){
$re = array();
Thanks for your good work.
-
2006-10-09
meff
Thank you so much! I've been running into this problem!!
I am using php5 with mod_suphp on apache2, this indeed fixes it.
THANK YOU!
-
2006-10-09
andi
Hmm interesting. Which distributions do you two use? What are the exact PHP versions?
-
2006-10-09
sept
Hi,
I am using debian sid, php5 version is 5.1.6-3, I aslo use xcache 1.0-4.1.
The exact setup is : lighttp+fastcgi+php5+xcache.
I can post the phpinfo() page if you need it (mail only).
Regards
-
2006-10-09
meff
Debian/sid i386 here too, PHP 5.1.6-1.
My setup is php5 + mod_suphp on Apache 2.0.55.
I suggest this change going into the next version, unless its a Debian related bug.. Please advise :)
-r
-
2006-10-09
andi
I already pushed a patch lowering the chunksize as suggested. Hower this is really strange, because everything works fine for me with Debian and PHP4 - maybe the max pattern size was reduced in Debian's PHP5 release for some reason?
-
2006-10-09
ChrisS
Just an FYI - I have no problems at the current chunksize using PHP4 (4.4.4) or PHP5 (5.1.6) running as modules on Apache 2.0 & Gentoo. I'll look and see what sort of performance hit there is at the different chunksizes, it might be something that needs to be a setting in dokuwiki.php.
Rodney, Stéphane, - are you able to work out your PCRE version?
(e.g. mine is 6.6 06-Feb-2006, phpinfo() will give you this information)
-
2006-10-09
sept
Hi,
Andreas I just check php4-cgi and php5-cgi source of the Debian package and MAX_PATTERN_SIZE if 1<<16 in both cases. But le pcre version are different.
I've just tested the exact same setup with php4 (4.4.4-1) from Debian Sid and guess what :
Warning: preg_match() [function.preg-match]: Compilation failed: repeated subpattern is too long at offset 18782 in /home/sept/logidee/web/dokuwiki-rc1/inc/common.php on line 453
if I set chunksize to 200 again all is ok.
So it must be a problem between your version of php4 (which version) and php{4,5} of sid... More precisely the version of pcre in php...
Regards
-
2006-10-09
sept
Hi Christopher,
For php4 pcre : 6.7 04-Jul-2006
For php5 pcre : 6.7 04-Jul-2006
Which is strange since the sources are a bit different :(
But good news both version have the very same problem ! ;p
Regards
-
2006-10-09
andi
Okay, just for the record, I'm using the current testing release which is 4.3.10-16, PCRE is 4.5 01-December-2003, so there seems to be some change in the PCRE library :-(
-
2006-10-10
outreal
Hi,
I had the same problem (Debian testing and unstable), and I tracked it down to the package libpcre3. Up to version 6.4 (libpcre3-6.4-2) it works flawlessly. Upgrading to 6.7 (libpcre3-6.7-1) brings the problem.
It's not affected by the version of php (tested with the latest debian php4 and php5 packages).
Hope it helps
-
2006-10-20
gb
PCRE on Debian bug :-)
-
2007-05-30
roshanjk
Great. Even I faced the same problem. After changing to "$chunksize = 200;" in the common.php, this problem was resolved.
-
Related tasks: