Hi everyone

After deploying my application on railway, i encountered an Application errror , the error says "The application failed to respond" So after encountering this i read the railway documentation which says "railway needs to know how to communicate with your application. When you deploy and expose a web application on Railway, we expect your web server to be available at host 0.0.0.0 and a port that we provide in the form of a PORT variable. The PORT variable is automatically injected by Railway into your application's environment." so basically the railway didn't know to communicate with my application because my application is running on a different host and port my application is built with Symfony, which is a PHP-based framework. how do i configure my application to be available at host 0.0.0.0 and a port that we provide in the form of a PORT as required by railway ? i have tried modifying my .env file by adding APP_HOST=0.0.0.0 APP_PORT=3000 but it didn't work i also tried runing the command "symfony server:start --host=0.0.0.0 --port=3000" on my terminal that didn't work work any idea on how i can resolve this please
26 Replies
Percy
Percy7mo ago
Project ID: N/A
Hassan Oladipupo
N/A
Brody
Brody7mo ago
what port does your app run on
Hassan Oladipupo
i'm using symfony default server which is 127.0.0.1:8000
Brody
Brody7mo ago
since you have set APP_HOST to 0.0.0.0 do your logs reflect that your app is running on the set host?
Hassan Oladipupo
No, it doesn't and that lead to my question that how do i successfuly configure my symfony application to be available on the set host reqiured by railway
Brody
Brody7mo ago
how do the symfony docs say to specify a host and port?
Hassan Oladipupo
yeah, that's the issue because In Symfony, which is a PHP-based framework, the server configuration is typically handled by the web server (e.g., Apache or Nginx) rather than directly in the application code. Symfony applications don't usually specify the host and port within the application code
Brody
Brody7mo ago
Hassan Oladipupo
i dont understand please
Brody
Brody7mo ago
follow the 3 steps on the page
Hassan Oladipupo
here is the depoly log
Brody
Brody7mo ago
build logs please
Brody
Brody7mo ago
send the dockerfile please
Hassan Oladipupo
here is it
Brody
Brody7mo ago
thats an incomplete dockerfile
Hassan Oladipupo
is that where the issue comes from and how do i resolve because that the Dockerfile i have in my application
Brody
Brody7mo ago
nvm seems like php:8.2-fpm provides what i thought was missing
Hassan Oladipupo
ohhh okay what could be the issue then
Brody
Brody7mo ago
try setting a service variable PORT to 9000 have you ran this dockerfile locally?
Hassan Oladipupo
yes i have the dockerfile locally and it works perfectly
Brody
Brody7mo ago
^ you are supplying your own dockerfile, you have to handle the server configuration
Hassan Oladipupo
How do i go about that please
Brody
Brody7mo ago
that question pertains more to php / symfony / fpm than is does to railway, please consult their docs to familiarize yourself with the technologies involved as per railways docs, your app needs to run on host 0.0.0.0 and the environment variable PORT, or a PORT service variable you set. how you do that is depended on your app and the technologies you are using, so please consult their docs
Hassan Oladipupo
Okay, Thank you for your time