Share in the Linux environment site hints 502 Bad Gateway solution __linux

Source: Internet
Author: User
Tags fpm


Site Access Tips 502 Bad gateway how to solve. According to the analysis is generally the PHP thread open file handle restricted caused.

share in Linux environment site hints 502 Bad Gateway solution


1, raise the file handle of the server open open vi/etc/security/limits.conf bottom plus * Soft nofile 51200* hard nofile 51200vi/etc/sysctl.conf Bottom Add fs.file-m ax=51200

2, the promotion Nginx process file open number Vi/www/wdlinux/nginx/conf/nginx.confworker_rlimit_nofile 5120; Changed into Worker_rlimit_nofile 51200;

3, modify the php-fpm.conf document, the main need to modify 2 places. Vi/www/wdlinux/etc/php-fpm.conf changed to the following value <value name= "max_requests" >10240</value><value name= "Rlimit_" Files ">51200</value>

4, set PHP-FPM automatic start vi/etc/rc.local finally add/etc/init.d/php-fpm start

5, after the completion of Reboot reboot server Ulimit-n view


Source reference resource sharing network: www.5azyw.com/thread-1296-1-1.html

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.