[php] Whoops, looks like something went wrong. Laravel 5.0

I installed Laravel 5.0 properly by cloning in git, and composer install, when I ran it to browser http://localhost/laravel/public/, it says

"Whoops, looks like something went wrong."

I did not make any changes after composer install.

Update after copy the env.example to .env this is result

RuntimeException in compiled.php line 5599: OpenSSL extension is required.

This question is related to php laravel-5

The answer is


Check, which PHP version is running on your WAMP,XAMPP or LARAGAN server. It should be greater than 7.0.

  1. Go to project folder like "C:\wamp\www\laravel".
  2. Open the file name of .env.example. (By using any editor like sublime, notepad++ and so on).
  3. Save as a .env

Then run your LARAVEL program. Hope it will work.

You can check whether how to change the PHP version in your current server. xampp, wamp


  1. Rename the .env.example to .env
  2. Go to bootstrap=>app.php and uncomment $app->withEloquent();
  3. Make sure that APP_DEBUG=true in .env file. Now it will work.

Try this:

sudo chown -R www-data pathto/.env

BECAUSE IF After Creating the .env file or/and Generating the Key by

php artisan key:generate

just as explained previously by others, and it still persists Try the following:

ls path/.env -al

if apache doesn't have access to it by displaying

www-data

as one one of the users i mean like

-rw-rwx--- 1 www-data rootuser 575 Nov 4 06:34 pathto/.env

This as stated above should resolve it. Especially when your laravel.log file keeps complaining that the key hasn't been generated or added.

sudo chown -R www-data pathto/.env


Go to project directory then follow below steps.

step 1: rename file .env.example `to .env

mv .env.example .env (for linux)

step 2: php artisan key:generate

This worked for me:

  1. Go to the .env file and be sure APP_DEBUG=true
  2. Here (in .env file) change reemplace 127.0.0.1 for localhost for check if your DB credential are corrects.
  3. Go to the config folder and do. the step #2.

Please, try to find something like:

./website/config/app.php and set 'debug' => env('APP_DEBUG', false) as 'true' 'debug' => env('APP_DEBUG', true)

This is happening because there is a field in .env file named, APP_KEY, which is blank now, we need some random key for this variable.

Follow these steps to get rid of this problem.

1) .env.example to .env

2) Go to your root directory in your command prompt (If you are using windows)/terminal (If you are using MAC or LINUX) where you have installed laravel project/files and run following command

php artisan key:generate

and then run your project. It's all done.


make sure app/storage dir permission is set to 755 and owner is set to admin. and also check permission and owner of files and dir in app/storage too


You can copy these files from template "blog" laravel

enter image description here


I renamed the .env.example to .env and ensure

APP_ENV=local 

which showed me the actual error. It was related to key. Then I issued

php artisan key:generate 

command and it worked


  • Give write permission to storage and bootstrap/cache directories
  • Rename .env.example file to .env
  • If you get "RuntimeException... No supported encrypter found. The cipher and / or key length are invalid." error, stop the application and generate key from command line "php artisan key:generate"
  • If your get "OpenSSL extension is required" error, enable the openssl extension by opening php.ini in php installation folder and uncommenting the line extension=php_openssl.dll by removing the semicolon at the beginning

Create a new .env file and copy the code of .env.example and run the command -> php artisan key:gen


In Laravel 5.5, I had the same issue

.env

was added to .gitignore.

So Either remove ".env" it from .gitignore file.

or add it forcefully

git add .env -f

And Deploy it. It will work.

If above does not help. Try generating the Key Again

php artisan key:generate

in process of uploading env file to cpanel,

sometimes the dot is taken out and this may raised the error.

this solution worked for me.

go to your cpanel and rename env file to .env


Follow these steps to this problem for all versions of your laravel like laravel 5.5

Step: 1

Rename file .env.example to .env

Step: 2

Go to your Command prompt/terminal and change path to project directory. Generate key for your application. This is unique for every application so don't make copy paste.

Just run the following command. Key will automatically save to your .env file

php artisan key:generate

For windows users, make sure apache's ssl_module is checked.

Please see image below:

enter image description here


Try to type in cmd: php artisan key:generate the problems will be solved


Simply type in terminal in your command prompt go to laravel directory path and type php artisan key:generate then key will be generated. Paste that key in config/app.php key variable. Your problem will be solved. I also did like that inorder to solve the problem...


First run command composer install

Then check for .env.example and .env files in your project folder.

.env file is your main configuration file for database and .env.example is backup file for .env file.

.env.example file will always be there but sometimes .env file can be missing. just copy the .env.example file and paste in the same project folder with filename .env .

now run php artisan key:generate command. this will generate key for your application.