I've got this message while debugging a problem in a PHP program.
- I've already edited the /etc/security/limits.conf and added
* hard nofile 500000 * soft nofile 500000 root hard nofile 500000 root soft nofile 500000
as instructed here (https://rtcamp.com/tutorials/linux/increase-open-files-limit/). After that, typing
reveals the new limit, 500000.
- I've already edited the /etc/pam.d/common-session file and added the line
session required pam_limits.so
I've then rebooted the system. My program continues to throw an exception when it tries to open file #1025.
I got the php process PID (27263) and then did a cat /proc/27263/limits
Limit Soft Limit Hard Limit Units Max cpu time unlimited unlimited seconds Max file size unlimited unlimited bytes Max data size unlimited unlimited bytes Max stack size 10485760 unlimited bytes Max core file size 0 unlimited bytes Max resident set unlimited unlimited bytes Max processes 95124 95124 processes Max open files 1024 4096 files Max locked memory 65536 65536 bytes Max address space unlimited unlimited bytes Max file locks unlimited unlimited locks Max pending signals 95124 95124 signals Max msgqueue size 819200 819200 bytes Max nice priority 0 0 Max realtime priority 0 0 Max realtime timeout unlimited unlimited us
As you can see, even after setting those system wide configurations, the PHP process still has a 1024 max open files limit.
Why?? How can I change that? Why aren't the system wide settings working for this particular case?