![]() In this case, PHP-FPM closes the connection even before the response is sent, and NGINX returns a 502 error. If the server takes too long to respond, then a 502 error can be caused by a PHP-FPM timeout. If no PHP-FPM processes are displayed as a result of this command, then you need to run PHP-FPM to resolve error 502. If you are on Linux, you can check if PHP-FPM is running using the following command: ps aux | grep php-fpm The next reason for the 502 error is that PHP-FPM is not running. If in the response you see that the status is inactive (dead), then you need to start NGINX. To do this, run the following command: systemctl status nginx If you see error 502, you need to check if NGINX is running. Let’s take a look at some of the possible reasons for the 502 Bad Gateway. ![]() The use of separate services is very important to improve efficiency. Web requests are processed over a TCP/IP socket, NGINX only handles HTTP requests, and PHP-FPM interprets PHP code. PHP works as an isolated service if you are using PHP-FPM. PHP-FPM together with NGINX can significantly increase the performance of websites and reduce resource consumption at the same time. PHP-FPM (PHP-FastCGI Process Manager) is a web request processing tool for PHP applications. Below we will look at the main ones, as well as possible ways to fix this error. For example:Īlso, the appearance of the page that displays the 502 error can be customized on different sites in the same way as it is done for the 404 not found error. There are different names for the 502 error that you can see on different sites. NGINX returns error 502 if it cannot connect to PHP-FPM or PHP-FPM is not responding. When connecting to another server, it returns an error. This happens when one server acts as a proxy to receive information from another server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |