Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.env problem #6032

Closed
sitesense opened this issue Oct 9, 2014 · 13 comments
Closed

.env problem #6032

sitesense opened this issue Oct 9, 2014 · 13 comments

Comments

@sitesense
Copy link

I've seen complaints that dev version can't be installed at the moment.

The problem is a missing .env file.
We currently have .env.example in the root folder, renaming to .env fixes the current issue.

Sorry for the brevity, I'm off to bed :)

@bachmacintosh
Copy link

Some additional info for the developers.

Duplication

Install a Laravel 5 app via Composer by running the following on a Vagrant box. This was run in the ~/Code directory.

composer create-project laravel/laravel bachmac dev-develop

Expected Outcome

Composer acquires all dependencies, generates a composer.lock and composer.json file, generates an autoload file, and creates a new Laravel 5 project successfully with no errors

Actual Outcome

Composer acquires all dependencies, generates a composer.lock and composer.json file, and attempts to generate an autoloader; howerver it fails due to this error:


Writing lock file
Generating autoload files
PHP Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Dotenv: Environment file .env not found. Create file with your environment settings at /home/vagrant/Code/bachmac/bootstrap/../.env' in /home/vagrant/Code/bachmac/vendor/vlucas/phpdotenv/src/Dotenv.php:20
Stack trace:
#0 /home/vagrant/Code/bachmac/bootstrap/environment.php(16): Dotenv::load('/home/vagrant/C...')
#1 /home/vagrant/Code/bachmac/bootstrap/start.php(27): require('/home/vagrant/C...')
#2 /home/vagrant/Code/bachmac/artisan(30): require_once('/home/vagrant/C...')
#3 {main}
thrown in /home/vagrant/Code/bachmac/vendor/vlucas/phpdotenv/src/Dotenv.php on line 20


This error occurs multiple times with various dependencies installed from Composer.

@remoblaser
Copy link

Can confirm this, just tried to get the dev version but getting the same error

@anhskohbo
Copy link
Contributor

Same problem.

@provun
Copy link

provun commented Oct 10, 2014

Same issue

@ed-fruty
Copy link
Contributor

Solution is (after exception in console):

  1. Rename ".env.example" to ".env"
  2. Move it to the directory above
  3. Clean up your project directory
  4. Run composer creating laravel project again
  5. While it downloading dependencies, copy your ".env" file to the project directory.

@jasonlewis
Copy link
Contributor

You shouldn't need to do all that. It only fails the
post-create-project-cmd which if I can remember correctly only tries to set
the application key. Just rename the .env.example to .env and you're good
to go. Set your application key or run the command.

On Fri, Oct 10, 2014 at 11:03 PM, ed-fruty notifications@github.com wrote:

Solution is (after exception in console):

  1. Rename ".env.example" to ".env"
  2. Move it to the directory above
  3. Clean up your project directory
  4. Run composer creating laravel project again
  5. While it downloading dependencies, copy your ".env" file to the project
    directory.


Reply to this email directly or view it on GitHub
#6032 (comment).

@provun
Copy link

provun commented Oct 10, 2014

But if you do that each time you have to run the create and then do an
update after you create the file. Obviously it needs fixing

From: Jason Lewis notifications@github.com
Reply-To: laravel/framework
<reply@reply.gith
ub.com>
Date: Friday, 10 October 2014 14:01
To: laravel/framework framework@noreply.github.com
Cc: Andrew Creed andy@provun.com
Subject: Re: [framework] .env problem (#6032)

You shouldn't need to do all that. It only fails the
post-create-project-cmd which if I can remember correctly only tries to set
the application key. Just rename the .env.example to .env and you're good
to go. Set your application key or run the command.

On Fri, Oct 10, 2014 at 11:03 PM, ed-fruty notifications@github.com wrote:

Solution is (after exception in console):

  1. Rename ".env.example" to ".env"
  2. Move it to the directory above
  3. Clean up your project directory
  4. Run composer creating laravel project again
  5. While it downloading dependencies, copy your ".env" file to the project
    directory.


Reply to this email directly or view it on GitHub
#6032 (comment).


Reply to this email directly or view it on GitHub
#6032 (comment) .
{"@context":"http://schema.org","@type":"EmailMessage","description":"View
this Issue on
GitHub","action":{"@type":"ViewAction","url":"https://github.com/laravel/fra
mework/issues/6032#issuecomment-58651877","name":"View Issue"}}

@jasonlewis
Copy link
Contributor

Shouldn't need to do an update. It will be fixed, don't stress.
On 11 Oct 2014 00:04, "provun" notifications@github.com wrote:

But if you do that each time you have to run the create and then do an
update after you create the file. Obviously it needs fixing

From: Jason Lewis notifications@github.com
Reply-To: laravel/framework
<reply@reply.gith
ub.com>
Date: Friday, 10 October 2014 14:01
To: laravel/framework framework@noreply.github.com
Cc: Andrew Creed andy@provun.com
Subject: Re: [framework] .env problem (#6032)

You shouldn't need to do all that. It only fails the
post-create-project-cmd which if I can remember correctly only tries to
set
the application key. Just rename the .env.example to .env and you're good
to go. Set your application key or run the command.

On Fri, Oct 10, 2014 at 11:03 PM, ed-fruty notifications@github.com
wrote:

Solution is (after exception in console):

  1. Rename ".env.example" to ".env"
  2. Move it to the directory above
  3. Clean up your project directory
  4. Run composer creating laravel project again
  5. While it downloading dependencies, copy your ".env" file to the
    project
    directory.


Reply to this email directly or view it on GitHub
#6032 (comment).


Reply to this email directly or view it on GitHub
#6032 (comment)
.
{"@context":"http://schema.org","@type":"EmailMessage","description":"View

this Issue on
GitHub","action":{"@type":"ViewAction","url":"
https://github.com/laravel/fra
mework/issues/6032#issuecomment-58651877","name":"View Issue"}}


Reply to this email directly or view it on GitHub
#6032 (comment).

@provun
Copy link

provun commented Oct 10, 2014

Cool thanks

From: Jason Lewis notifications@github.com
Reply-To: laravel/framework
<reply@reply.gith
ub.com>
Date: Friday, 10 October 2014 14:09
To: laravel/framework framework@noreply.github.com
Cc: Andrew Creed andy@provun.com
Subject: Re: [framework] .env problem (#6032)

Shouldn't need to do an update. It will be fixed, don't stress.
On 11 Oct 2014 00:04, "provun" notifications@github.com wrote:

But if you do that each time you have to run the create and then do an
update after you create the file. Obviously it needs fixing

From: Jason Lewis notifications@github.com
Reply-To: laravel/framework
<reply@reply.gith
ub.com>
Date: Friday, 10 October 2014 14:01
To: laravel/framework framework@noreply.github.com
Cc: Andrew Creed andy@provun.com
Subject: Re: [framework] .env problem (#6032)

You shouldn't need to do all that. It only fails the
post-create-project-cmd which if I can remember correctly only tries to
set
the application key. Just rename the .env.example to .env and you're good
to go. Set your application key or run the command.

On Fri, Oct 10, 2014 at 11:03 PM, ed-fruty notifications@github.com
wrote:

Solution is (after exception in console):

  1. Rename ".env.example" to ".env"
  2. Move it to the directory above
  3. Clean up your project directory
  4. Run composer creating laravel project again
  5. While it downloading dependencies, copy your ".env" file to the
    project
    directory.


Reply to this email directly or view it on GitHub
#6032 (comment).


Reply to this email directly or view it on GitHub
#6032 (comment)
.
{"@context":"http://schema.org","@type":"EmailMessage","description":"View

this Issue on
GitHub","action":{"@type":"ViewAction","url":"
https://github.com/laravel/fra
mework/issues/6032#issuecomment-58651877","name":"View Issue"}}


Reply to this email directly or view it on GitHub
#6032 (comment).


Reply to this email directly or view it on GitHub
#6032 (comment) .
{"@context":"http://schema.org","@type":"EmailMessage","description":"View
this Issue on
GitHub","action":{"@type":"ViewAction","url":"https://github.com/laravel/fra
mework/issues/6032#issuecomment-58652720","name":"View Issue"}}

@jonathanpmartins
Copy link
Contributor

@sitesense, @remoblaser, @anhskohbo, @provun, @jasonlewis
Can they say if this issue has been corrected?
In my projects .env files work perfectly fine in L5.

@anhskohbo
Copy link
Contributor

Work fine! Close issue, please.

@jonathanpmartins
Copy link
Contributor

@GrahamCampbell this issue can be closed!

@GrahamCampbell
Copy link
Member

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants