PCRE limits exceeded FIX

When ModSecurity is in use, you may come across error like: Execution error – PCRE limits exceeded (-8): (null) in apache error log.


To fix this error, refer to following steps:

1. SSH the server as root and chnage the directory to apache onfiguration.

cd /usr/local/apache/conf

touch pcre_modsecurity_exceeded_limits.conf

2. Add following contents to the file.

SecPcreMatchLimit 150000
SecPcreMatchLimitRecursion 150000


3. Change file permission to 600

chmod 600 /usr/local/apache/conf/pcre_modsecurity_exceeded_limits.conf

4. edit mod_security configuration file.

On cpanel server it’s /usr/local/apache/conf/modsec2.user.conf

5. look for line <IfModule mod_security2.c> and add below line just below the it.

Include “/usr/local/apache/conf/pcre_modsecurity_exceeded_limits.conf”


6. Restart apache service.

/etc/init.d/httpd restart

That’s all 🙂


Post to Twitter

Leave a Reply

Your email address will not be published. Required fields are marked *