Re: PHP PREG and recursions causes crash
Posted by:
toxicsyntax
(---.ds1-khk.adsl.cybercity.dk)
Date: August 10, 2010 11:35PM
Well, it is a string that will be handled in different ways, depending on what is in it. One of the things that the string may contain is a comma-separated list of numbers, like this "124,4363,232453,2324,23253,...". The string may be very long (like, more than 3000 characters).
I test the string against different regular expressions, and this is where I see the unexpected stack error. I expect I would be able to test for this in some other way, like using explode() and intval() in some combination, but it really intriges me why preg_match causes the apache server to restart?!
As I said, I have narrowed it down to something with recursion limit, as I can get the regular expression to fail with a PREG_RECURSION_LIMIT_ERROR by lowering the preg.recursion_limit (in php.ini) to 686. If it is 687 or higher, the regular expression causes the Apache server to crash and restart.
By the way, this may be a more general problem with Apache or PHP on Windows, as tried to uninstall WAMP and install Apache and PHP separately, and I saw the same error there. It works on my production server, which is Debian Linux, however.