I'm trying to deploy a symfony app to heroku but after the command "git push heroku master" i got this error
*remote: Script cache:clear returned with error code 255
remote: !! PHP Fatal error: Uncaught RuntimeException: APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file. in /tmp/build_c283120b0d4ffbcbe11960331dfe8069/bin/console:20
remote: !! Stack trace:
remote: !! #0 {main} remote: !! thrown in /tmp/build_c283120b0d4ffbcbe11960331dfe8069/bin/console on line 20 remote: !! remote: Script @auto-scripts was called via post-install-cmd remote: ! WARNING: The APP_ENV environment variable is missing remote: ! Run 'heroku config:set APP_ENV=prod' to set it.
remote: remote: ! ERROR: Dependency installation failed!
remote: ! remote: ! The 'composer install' process failed with an error. The cause remote: ! may be the download or installation of packages, or a pre- or remote: ! post-install hook (e.g. a 'post-install-cmd' item in 'scripts') remote: ! in your 'composer.json'.
remote: ! remote: ! Typical error cases are out-of-date or missing parts of code, remote: ! timeouts when making external connections, or memory limits.
remote: ! remote: ! Check the above error output closely to determine the cause of remote: ! the problem, ensure the code you're pushing is functioning remote: ! properly, and that all local changes are committed correctly.
remote: ! remote: ! For more information on builds for PHP on Heroku, refer to remote: !
https://devcenter.heroku.com/articles/php-supportremote: ! remote: ! REMINDER: the following warnings were emitted during the build; remote: ! check the details above, as they may be related to this error: remote: ! - The APP_ENV environment variable is missing
remote: remote: ! Push rejected, failed to compile PHP app.
remote: remote: ! Push failed remote: Verifying deploy...*
I changed the line APP_ENV=dev to APP_ENV=prod on .env file but nothing changed... any ideas? How do I add "symfony/dotenv" as a Composer dependency?