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
Project ID:
N/A
N/A
what port does your app run on
i'm using symfony default server which is 127.0.0.1:8000
since you have set APP_HOST to 0.0.0.0 do your logs reflect that your app is running on the set host?
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
how do the symfony docs say to specify a host and port?
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
build and deploy logs please https://bookmarklets.up.railway.app/log-downloader/
i dont understand please
follow the 3 steps on the page
here is the depoly log
build logs please
here's it
send the dockerfile please
here is it
thats an incomplete dockerfile
is that where the issue comes from and how do i resolve because that the Dockerfile i have in my application
nvm seems like
php:8.2-fpm
provides what i thought was missingohhh okay
what could be the issue then
try setting a service variable PORT to 9000
have you ran this dockerfile locally?
yes i have the dockerfile locally and it works perfectly
^
you are supplying your own dockerfile, you have to handle the server configuration
How do i go about that please
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
Okay, Thank you for your time