PHP failed to open stream: too many open files

I have a problem with the error: PHP could not open the stream: Too many open files.

I examined various answers here in stackoverflow, but I cannot solve this problem. I basically tried to increase the max limit. open files:

I edited /etc/security/limits.conf where I pointed this out:

*       soft    nofile      10000
*       hard    nofile      30000

After saving and logging off / rebooting the window, the command:

ulimit -n

Still prints 1024. I'm not sure why this has no effect, and I think this is the reason I get the php error. If necessary, I can insert the entire file or any other configuration file. I am using PHP 5.6, nginx 1.8.0 and php-fpm.

The solution that works for me now is to restart nginx manually:

service nginx restart

. , , -.

+4
3

, , . 10000. , - .

0

, - , . - , ? , ? , . ; , / , ? " -", "" , ?

, , - - , .

+2

You should increase the user file limit for users running php processes. Check with which user your php processes are running and increase the limit for them. You can do it. $ cat /etc/security/limits.conf * hard nofile 500000 * soft nofile 500000 root hard nofile 500000 root soft nofile 500000 www-data hard nofile 500000 www-data soft nofile 500000

link: https://rtcamp.com/tutorials/linux/increase-open-files-limit/

+2
source

Source: https://habr.com/ru/post/1608288/


All Articles