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
Percy12mo ago
Project ID: N/A
Hassan Oladipupo
Hassan Oladipupo12mo ago
N/A
Brody
Brody12mo ago
what port does your app run on
Hassan Oladipupo
Hassan Oladipupo12mo ago
i'm using symfony default server which is 127.0.0.1:8000
Brody
Brody12mo 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
Hassan Oladipupo12mo ago
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
Brody12mo ago
how do the symfony docs say to specify a host and port?
Hassan Oladipupo
Hassan Oladipupo12mo ago
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
Brody12mo ago
Hassan Oladipupo
Hassan Oladipupo12mo ago
i dont understand please
Brody
Brody12mo ago
follow the 3 steps on the page
Hassan Oladipupo
Hassan Oladipupo12mo ago
here is the depoly log
Brody
Brody12mo ago
build logs please
Brody
Brody12mo ago
send the dockerfile please
Hassan Oladipupo
Hassan Oladipupo12mo ago
here is it
Brody
Brody12mo ago
thats an incomplete dockerfile
Hassan Oladipupo
Hassan Oladipupo12mo ago
is that where the issue comes from and how do i resolve because that the Dockerfile i have in my application
Brody
Brody12mo ago
nvm seems like php:8.2-fpm provides what i thought was missing
Hassan Oladipupo
Hassan Oladipupo12mo ago
ohhh okay what could be the issue then
Brody
Brody12mo ago
try setting a service variable PORT to 9000 have you ran this dockerfile locally?
Hassan Oladipupo
Hassan Oladipupo12mo ago
yes i have the dockerfile locally and it works perfectly
Brody
Brody12mo ago
^ you are supplying your own dockerfile, you have to handle the server configuration
Hassan Oladipupo
Hassan Oladipupo12mo ago
How do i go about that please
Brody
Brody12mo 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
Hassan Oladipupo12mo ago
Okay, Thank you for your time
Want results from more Discord servers?
Add your server