# mod_security Rule execution error - PCRE limit exceeded

## vaccinus

Hello!

Can someone help me with problem:

I'v got "Message: Rule execution error - PCRE limits exceeded (- :Cool: : (null)." in modsec_audit.log

I'v changed:

/etc/php/apache2-php5/php.ini 

pcre.backtrack_limit=1000000

pcre.recursion_limit=1000000

/etc/apache2/modules.d/mod_security/10_config.conf

SecPcreMatchLimit 150000

SecPcreMatchLimitRecursion 150000

Got: 

pcretest -C

PCRE version 7.9 2009-04-11

Compiled with

  UTF-8 support

  Unicode properties support

  Newline sequence is LF

  \R matches all Unicode newlines

  Internal link size = 2

  POSIX malloc threshold = 10

  Default match limit = 10000000

  Default recursion depth limit = 8192

  Match recursion uses stack

So I need to set large "Default recursion depth limit", is that correct?

How to deal with it? 

dev-libs/libpcre-7.9-r1

www-servers/apache-2.2.15

dev-lang/php-5.2.13

Tahnks in advance ? :Smile: 

----------

## Hu

Recursion limits are imposed to avoid killing the system when you write deeply recursive patterns.  You may be better served by fixing your patterns than by trying to change the limits.

----------

