I'm trying to upload a Lumen project in Amazon Elastic Beanstalk.
.env is in .gitignore.
This is OK, because I have several environement ( dev, qa, prod), so I need to configure have separate env variable for each environement
I get this error message:
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Dotenv: Environment file .env not found or not readable. Create file with your environment settings at /var/app/current/bootstrap/../.env' in /var/app/current/vendor/vlucas/phpdotenv/src/Dotenv.php:33 Stack trace: #0 /var/app/current/bootstrap/app.php(4): Dotenv::load('/var/app/curren...') #1 /var/app/current/public/index.php(13): require('/var/app/curren...') #2 {main} thrown in /var/app/current/vendor/vlucas/phpdotenv/src/Dotenv.php on line 33
I understand that system doesn't find .env
Thing is I have set variables in Amazon Console :
Software Configuration
Environment variables: APP_ENV, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_HOST, APP_KEY
eb printenv :
Environment Variables:
DB_DATABASE = ebdb
DB_PASSWORD = xxxxxxxx
APP_KEY = xAY4hnrXlht5fdvB9PzPAwDqc1R
DB_HOST = xxxxxxcnzd3rux8ue7.us-east-1.rds.amazonaws.com:3306
APP_ENV = dev
DB_USERNAME = myuser
I also have in .ebextensions/environment.config :
container_commands:
# Copy EB env configuration file over
01_config_environment:
command: mv /var/app/ondeck/.env.elasticbeanstalk /var/app/ondeck/.env
02-install-packages:
command: "composer.phar install -d /var/app/ondeck/www"
option_settings:
option_name: DB_HOST
value: xxxxxxx.cnzd3rux8ue7.us-east-1.rds.amazonaws.com
- option_name: DB_PORT
value: 3306
- option_name: DB_NAME
value: ebdb
- option_name: DB_USER
value: myuser
- option_name: DB_PASS
value: xxxxxx
But can't get rid of this error!