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.