

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.
PHPMYADMIN NGINX ALL ICONS BROKEN HOW TO
For getting more detailed information about MetricFire and how to integrate it with your system, book a demo with our team or sign up on MetricFire for the free trial. Use MetricFire's platform to analyze your system’s performance and troubleshoot errors. In this article, we will look at the main possible causes and how they can be solved by users and web developers. There are various possible reasons for this error and different ways to solve it. The NGINX Error 502 Bad Gateway is a common error among website users. Monitoring your system metrics with Hosted Graphite by MetricFire.
