Error 502, Application failed to respond

emmakade
FREE

a month ago

Good day or good evening, I'm new on railway. I just deploy a laravel project to railway now, The deployment was successful but i can't access my links and api, i keep getting 502 error, kindly check below:

Application failed to respond

This error appears to be caused by the application.

If this is your project, check out your deploy logs to see what went wrong. Refer to our docs on Fixing Common Errors for help, or reach out over our Help Station.

Solved$10 Bounty

5 Replies

What port do you have your domain pointing to?


loudbook

What port do you have your domain pointing to?

emmakade
FREE

a month ago

i didn't add any i allow railway to inject it automatically by defining this "php artisan serve --host=0.0.0.0 --port=$PORT" in my procfile

and also adding this to my deploy start command:

php artisan optimize && php artisan config:cache && php artisan route:cache && php artisan view:cache && php artisan migrate --force && php artisan serve --host=0.0.0.0 --port=$PORT && chmod -R 775 storage bootstrap/cache


emmakade

i didn't add any i allow railway to inject it automatically by defining this "php artisan serve --host=0.0.0.0 --port=$PORT" in my procfileand also adding this to my deploy start command:php artisan optimize && php artisan config:cache && php artisan route:cache && php artisan view:cache && php artisan migrate --force && php artisan serve --host=0.0.0.0 --port=$PORT && chmod -R 775 storage bootstrap/cache

emmakade
FREE

a month ago

Can i drop my Project Id?


Delete port=$PORT in both those commands and just have the PORT variable be set to 8000. Then make sure your domain points to 8000.


loudbook

Delete port=$PORT in both those commands and just have the PORT variable be set to 8000. Then make sure your domain points to 8000.

emmakade
FREE

a month ago

thank you very much, it work


Status changed to Solved chandrika about 1 month ago