ID:               47989
 User updated by:  jimriver76 at yahoo dot co dot uk
 Reported By:      jimriver76 at yahoo dot co dot uk
 Status:           Open
 Bug Type:         PCRE related
 Operating System: windows server 2003
 PHP Version:      5.2.9
 New Comment:

The way I 'fixed' it is uncommenting the pcre.recursion_limit line in
php.ini


Previous Comments:
------------------------------------------------------------------------

[2009-04-16 15:10:19] jimriver76 at yahoo dot co dot uk

Description:
------------
Since Feb 2009, all php scripts in my server suddently and selectively
produced an curious error message in php log as following:

[code]
[16-Apr-2009 22:03:00] PHP Fatal error:  Nesting level too deep -
recursive dependency? in D:\websites\nameclub\include\common.inc.php on
line 56
[/code]

This proplem continued even after I upgrade to the current 5.2.9
version.

After checking all those lines of code, I found some similarities of
that issue. They always caused by preg_replace or preg_match: 

[code]
$boardurl =
'http://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api|archiver|wap)?\/*$/i",
'', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/';
[/code]

[code]
// $cip = 124.227.153.46 
preg_match("/[\d\.]{7,15}/", $cip, $cips);
[/code]

Another curious characteristic is that it dosen't happen always.
Instead, it ran into this problem only at a 1/3 chance. Normally, after
I refleshed the same page, it worked just fine. That is why I believe it
should be reported as a bug. 

Btw, I could provide some help if one of you ever have this kind of
problem. The way I 'fixed' it is uncomment the pcre.recursion_limit
line

;pcre.recursion_limit=100000

I don't know why but it just fixed the issue perfectly for me.

Yes I search a lot by the 'Nesting level too deep' keywords, but found
none of them related to pcre extension, which I believe that mine has
connection with.


Reproduce code:
---------------
$boardurl =
'http://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api|archiver|wap)?\/*$/i",
'', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/';


...
// $cip = 124.227.153.46 
preg_match("/[\d\.]{7,15}/", $cip, $cips);


Expected result:
----------------
null



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47989&edit=1

Reply via email to