I am trying to deploy a Laravel application in Elastic Beanstalk in development mode. To make the application run in development mode, and not in production, I did the following in my file /bootstrap/start.php:
$env = $app->detectEnvironment(function() {
return $_ENV['ENV_NAME'];
});
To create an environment variable, I created a file .configin the following path: /.ebextensions/00environmentVariables.configwith this content:
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: ENV_NAME
value: development
- option_name: DB_HOST
value: [redacted]
- option_name: DB_PORT
value: [redacted]
- option_name: DB_NAME
value: [redacted]
- option_name: DB_USER
value: [redacted]
- option_name: DB_PASS
value: [redacted]
When I run eb startfrom the command line, it spins an instance of EC2 and tries to provide it, after which it informs me of an error. and check the logs. In the logs I can see these entries:
PHP note: Undefined index: ENV_NAME in /var/app/ondeck/bootstrap/start.php on line 28
Note: Undefined index: ENV_NAME in /var/app/ondeck/bootstrap/start.php on line 28
- ENV_NAME , 00environmentVariables.config. , , , EB:

:
- , .config
- - Laravel - ,
ENV_NAME eixsts ENV_NAME eixsts .config, Elastic Beanstalk
, , HTTP- Apache, PHP CLI.
, ENV_NAME /usr/bin/composer.phar install.
, - CLI PHP, Apache.
, SSH'd EC2, Laravel Elastic Beanstalk, , `` printenv`:
ENV_NAME=development
, die(var_dump($_SERVER)); PHP CLI, , . $_ENV getenv().
PHP CLI, , Apache PHP-?
test.php : die(var_dump($_ENV));.
php test.php, , , CLI PHP.