It was updated on Centos 7 and on the home server the problem got out. Virtualmin is installed on the server. The web server runs on a bare apache without nginx, but with php-fpm, with which I switch php versions. I need it for work.

After some time, the Apache falls with this error:

mod_fcgid: stderr: PHP Warning: Unknown: failed to open stream: Too many open files in Unknown on line 0 

Googled, found how to increase the resolution on the number of files applied.

 # su printforms sh-4.2$ ulimit -n 400000 

But the falls did not stop. I created a php file on this virtual host with the following contents:

 <?php system('ulimit -n'); 

I get back 1024

How to make Apache accept system values? Or how to register these limits in the Apache? Preferably globally. And then I constantly create or clean new platforms.

    1 answer 1

    Create the file /etc/systemd/system/httpd.service.d/10-limits.conf with the contents:

     [Service] LimitNOFILE=10240 

    Next, apply the changes:

     systemctl daemon-reload systemctl restart httpd 

    Valid limits:

     cat /proc/<PID>/limits