Setting up Symfony with Elastic Beanstalk

Posted by James on August 21, 2020

Apache Pack

Once you've installed Symfony, install Apache pack straight away:

composer require symfony/apache-pack

I spent a few hours banging my head against the wall tryting to figure out why only the front page would load and all of my routes threw 404s. Mostly, Apache pack puts an .htaccess file in your public directory so you can use it on a server. The AWS documentation rather glosses over this quite key detail.

Get rid of the debugger

In your .env file, add APP_ENV=prod Then, if you don't already have one, add a .env.local, and add APP_ENV=dev to it.