ModSecurity: Rule execution error – PCRE limits exceeded (-8)

Some times After browsing site we get a blank page and the Apache error logs display following error logs:

ModSecurity: Rule execution error – PCRE limits exceeded (-8): (null). [hostname “www.test.com”] [uri “/forum/login.php”]

In order to solve this error follow the steps:
Login to the server as root.
Go to directory /usr/local/apache/conf.

cd /usr/local/apache/conf

Create a file pcre_modsecurity_exceeded_limits.conf and insert following lines in it.

vi pcre_modsecurity_exceeded_limits.conf
SecPcreMatchLimit 150000
SecPcreMatchLimitRecursion 150000

Save and quit the file.

Please set the permissions for the file to 600.

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

Now open the file /usr/local/apachec/conf/modsec2.user.conf .

vi /usr/local/apachec/conf/modsec2.user.conf

Locate the line “<IfModule mod_security2.c>
Add following line just below the above mentioned line.

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

Save and quit the file.
Now just restart your apache and mysql service. The issue should be fixed now.

If you want to install Softaculous in WHM you can follow the simple steps here.