502 BadGateway exception caused by restricted file handles opened by php threads
Source: Internet
Author: User
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/etc/security/limits. conf by upgrading the file handle of the server. :( add )*?? So php thread error 502 Bad Gateway caused by restricted file handle opening
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_nofile 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 the above modification is completed, restart PHP and the warning information is no longer available .? The world has never been peaceful, and 502 Bad Gateway is gone.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service