Skip to content
Problem starting symfony application
agazzi
OP

9 months ago

Hi Railway Support,

I’m experiencing an issue deploying a PHP/Symfony application.

The build completes successfully and the deployment shows as successful, but the application does not respond once deployed. I consistently get a 502 Bad Gateway.

What’s strange is that this is not limited to my custom project — even official boilerplate/templates do not work on my side. The build logs show no errors, the deploy completes normally, but the app never responds.

Here is what I’ve already checked:

  • Build completes without errors
  • Deployment status shows “successful”
  • No obvious runtime crash in logs
  • Domain is generated properly
  • No custom start command (also tested with/without one)
  • Tried setting NIXPACKS_PHP_ROOT_DIR=/app/public
  • Tried default networking configuration

It seems like the app process is either not binding correctly to the expected port or not being proxied properly, but logs don’t clearly indicate why.

Additionally, parts of the Symfony documentation for Railway appear outdated compared to the current UI/settings, which makes troubleshooting difficult.

Could you please help identify:

  1. Whether the service is actually binding to the expected internal port
  2. If there is a known issue with PHP/Symfony deployments
  3. If there is an updated, working minimal example for Symfony on Railway

Thank you in advance — I’m currently blocked on deployment.

Best regards,

William

$20 Bounty

2 Replies

Railway
BOT

9 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open Railway • 9 months ago


Are you sure that the port the URL is mapped to is the same port the application is listening to?

If that's already checked, something I'd do as a sanity check is to set both the application port and URL port to 3000 to see if that works.


Anonymous

14 days ago

One distinction to check before changing anything: your document root and your listening port are separate settings, and the PHP variable names depend on the builder.

  1. Read the build banner to confirm Nixpacks or Railpack. For Nixpacks, the NIXPACKS_PHP_ROOT_DIR=/app/public you tried is the documented Symfony root setting. For Railpack, the override is RAILPACK_PHP_ROOT_DIR=/app/public; Symfony detection normally selects that root automatically. A Nixpacks variable alone does not configure Railpack.

  2. Check the effective server/start command and the port the web server actually reports listening on. Railway needs an externally reachable listener on 0.0.0.0, with the public domain's target port matching that listener. Setting a document root does not establish either of those.

  3. If this is Railpack, its documented Symfony startup uses /start-container.sh and FrankenPHP. Check whether a custom start-container.sh or Caddyfile is overriding the generated settings. Do not replace the web-server command with a Composer/build command or a PHP-FPM-only process.

Please share the builder/version, sanitized effective start command and first runtime lines, and the domain's target port—no credentials or environment-variable dump. That will let us distinguish a listener mismatch from application startup failure. I cannot inspect your private service or confirm the root cause from the successful-build status alone, and I have not deployed a minimal Symfony example on Railway.

Sources:

https://railpack.com/languages/php/

https://nixpacks.com/docs/providers/php

https://docs.railway.com/networking/troubleshooting/application-failed-to-respond

AI-assisted; the configuration claims were checked against these official documents. No access to your deployment or successful remote test is claimed.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...