0

I have a Lumen application that is using the Dotenv library from vlucas. When trying to deploy, travis-ci complains that there is no ".env" file. Do I need to modify my bootstrap/app.php file to conditionally load the Dotenv class, or is there a better way to handle this?

The error message that I'm getting is:

PHP Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Dotenv: Environment file .env not found or not readable. Create file with your environment settings at /home/travis/build/project/repo/bootstrap/../.env' in /home/travis/build/project/repo/vendor/vlucas/phpdotenv/src/Dotenv.php:33

miken32
  • 42,008
  • 16
  • 111
  • 154
Brian Anderson
  • 621
  • 7
  • 22

1 Answers1

0

Be careful that the .env file at the root of your Lumen project is in the .gitignore shipped with Lumen.

If the file isn't relevant for you, you can comment the Dotenv::load(__DIR__.'/../'); line at the top of bootstrap/app.php.