Errors caused by restricted file handles opened by the php thread 502BadGateway the resources on the Internet are basically considered to be errors caused by restricted file handles opened by the php thread. The specific solution is as follows :? 1. open the file handle of the server and open etcsecuritylimits. conf: (add )*?? Soft ?? Nofile ?? 51200 *?? Hard ?? Error 502 Bad Gateway caused by limited file handle opened by nofile php thread
I have checked resources on the Internet, and I think it is an error caused by restricted file handles opened by the php thread. The specific solution is as follows:
?
1. open the file handle of the server
/Etc/security/limits. conf: (added)
*? ? Soft? ? Nofile? ? 51200
*? ? Hard? ? Nofile? ? 51200
# Vi/etc/security/limits. conf? Add
* Soft nofile 51200
* Hard nofile 51200
?
2. increase the number of opened processes in nginx
?
Nginx. conf: worker_rlimit_nofiles 51200;
?
3, modify the php-fpm.conf file, mainly need to modify 2.
?
Command ulimit-n to view the limit on the number of opened files, the option rlimit_files in the php-fpm.conf is sure to be consistent with this value.
?
? 10240
?
51200
?
4,
# Vi/etc/sysctl. conf?
Add at the bottom
Fs. file-max = 51200
After completing the preceding modification, restart PHP and the warning information is no longer displayed.
?
The world has never been peaceful, and 502 Bad Gateway is gone.