Solution: RedHat 7.2 Apache + php Segmentation fault error message

Latest response

RedHat 7.2
The parameter pcre.recursion_limit is set to 100000 by default. If recursion eats more memory than the system stack size can provide (commonly 8 MB),
PHP will error out on complex regular expressions showing a Segmentation fault error message.

Solution:

Create a new /etc/systemd/system/.d/ directory
For example:

mkdir /etc/systemd/system/httpd.service.d

Create a new /etc/systemd/system/.d/.conf drop-in config file with the desired setting in the appropriate context type
For example:

echo [Service] >/etc/systemd/system/httpd.service.d/ulimit.conf
echo LimitSTACK=infinity >>/etc/systemd/system/httpd.service.d/ulimit.conf

Execute systemctl daemon-reload

systemctl daemon-reload

Execute systemctl restart

systemctl restart httpd

Responses

Dmitry,

So you're saying that with the LimitSTACK set to infinity and SELinux enabled you stll had the issue?

Is there anything in the error log relating to SELinux?

SELinux = OK works

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.