502 Bad Gateway: php-fpm not answering (Native)

315 views 2 posts

Member

Stack is green, the site is 502. nginx log: upstream prematurely closed / connect to php-fpm failed. Project is on PHP 8.3. In Docker I used to restart the container — what here?

MacFullStack

Native is more honest than Docker: 502 almost always means “wrong FPM / not up / nginx looking at the wrong socket”, not compose magic.

Common causes:

  1. Pin to a PHP version that is not installed — install it under Runtime or change the pin.
  2. FPM did not come up after a version change — Apply on the PHP tab / restart the stack.
  3. Wrong docroot (no index.php) — you may see 404/403 first, sometimes 502 on a bad proxy.
  4. FPM socket mismatch after port changes — sync vhosts.

Read php-fpm and nginx logs in Tools / Log Hub. CLI: Doctor. Faster than docker compose logs.

No stack yet? Download Free and learn 502 on one project until it is boring. Help: /help/error-502-403, /blog/502-403-lokalno.

Reply

Sign in to create topics and reply.

Download Pro Teams