Framework: "Whoops, looks like something went wrong." on brand new project

Created on 31 Aug 2017  路  20Comments  路  Source: laravel/framework

  • Laravel Version: 5.5
  • PHP Version: PHP 7.0.22-0ubuntu0.17.04.1

Description:

Updated laravel to 5.5 via composer global update. Created a new project using laravel new foo

Ran php artisan foo

Moving .env.example to .env and running php artisan key:generate makes the error go away.

And when creating a new project I see the following in my terminal:

Generating optimized autoload files
You made a reference to a non-existent script @php -r "file_exists('.env') || copy('.env.example', '.env');"
You made a reference to a non-existent script @php artisan key:generate
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
You made a reference to a non-existent script @php artisan package:discover
Application ready! Build something amazing.

Most helpful comment

Hey @ikayyuddie try to find file .env in your project laravel. I have the same problem, thats the problem why its still doesn't work. Because .env file just gone, i don't know how it's gone. you just copy .env file from another project, and change .env file as you need

All 20 comments

Browse the issues. Same question has been asked several times in the last 24 hours.

Thanks for the quick response, friend. I'm sorry :) I did, but didn't see one. Can you point me at one?

20864

20831

20843

Looks like you just need to update your global composer dependencies so that laravel installer gets updated.

Thanks @devcircus

I did that. The issue was resolved by removing composer from dpkg and updating composer. https://github.com/laravel/framework/issues/20843#issuecomment-326100763 has a solution.

I found running composer global update as solution for this issue, but actually running composer global self-update solved the issue for me

This is because of your Laravel Installer or Composer version. I have faced the same problem and found following 2 different solutions:

  1. Generally you can solve with by running composer global update command and then run composer update command from your project directory. This solution basically updates your installer and then your project.

  2. If still, you have this issue, you need to run composer self-update command first and then run composer update command from your project directory. Here your composer will update and then your project.

Hope this answer will help you.

@itskawsar I have tried all you said, but the problem still persists. I am using Windows 10 and PHP 7.
Just dont seem to figure this out.

Hey @ikayyuddie try to find file .env in your project laravel. I have the same problem, thats the problem why its still doesn't work. Because .env file just gone, i don't know how it's gone. you just copy .env file from another project, and change .env file as you need

this helped

I had the same problem. @madun solution worked well

@madun Thanks, your solution helped.

I've tried a lot of solutions found on the Web, but none works. I've tried something just 5 min ago and It works like a charm.
That's what I've done :

  • remove my .env file from gitignore file.
  • Save the commit
  • Run : git push heroku master

Thanks for you help!

Looks like you need to set your environment variables on heroku. You shouldn't commit your .env file.

rename .env.example as .env. Open it and update the data (especially Database config)

I had the same issue. I got the error because the missing .env file

thanku it worked

It worked for env solution. Thanks for your kind guidance!

For me, it worked after doing changes in .env file...

Was this page helpful?
0 / 5 - 0 ratings