Nginx 502 Bad Gateway

Source: Internet
Author: User
The first reason for the nginx 502 Bad Gateway error of the one-click lnmp installation package is that the lnmp one-click installation package has many problems: 502 Bad Gateway. In most cases, the reason is that before installing PHP, some lib packages in the script may not be installed, resulting in PHP not being compiled and installed successfully.

Solution:
You can try to manually install the lnmp installation package according to the script in the one-click installation package to see what caused the error. Search for it online or send the error message. Let's analyze the cause of the error.

The second reason is:
In PHP. ini, The eaccelerator configuration item must be placed before Zend optimizer configuration; otherwise, it may cause 502 Bad Gateway

The third reason is:
502 problems occur during installation and use. Generally, the default PHP-CGI process is five, which may be caused by insufficient phpcgi processes, you need to modify/usr/local/PHP/etc/php-fpm.conf to add the max_children value as appropriate.
It is also possible that the max_requests value is insufficient.

The fourth reason is:
PHP Execution time-out. Modify/usr/local/PHP/etc/PHP. ini and change max_execution_time to 300.

Fifth reason:
Insufficient disk space. For example, MySQL logs occupy a large amount of space.

Sixth reason:
Check whether the PHP-CGI process is running

Today, I encountered this problem. After repeated searches, I found that the hard disk space was insufficient,

Then DF du looked at his hard disk and found that 100% was used, hoping to help everyone.

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.