Whoops, looks like something went wrong. Laravel 5.0

PhpLaravel 5

Php Problem Overview


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.

Php Solutions


Solution 1 - Php

The logs are located in storage directory. If you want laravel to display the error for you rather than the cryptic 'Whoops' message, copy the .env.example to .env and make sure APP_ENV=local is in there. It should then show you the detailed error messaging.

Solution 2 - Php

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. Rename .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.

Solution 3 - Php

  • 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

Solution 4 - Php

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

Solution 5 - Php

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

Solution 6 - Php

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...

Solution 7 - Php

Please, try to find something like:

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

Solution 8 - Php

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

Solution 9 - Php

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

Solution 10 - Php

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. https://stackoverflow.com/questions/23022609/how-to-change-default-path-of-php-in-xampp">xampp</a>;, https://stackoverflow.com/questions/22237695/how-to-downgrade-wampserver-php-and-apache">wamp</a>

Solution 11 - Php

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

Solution 12 - Php

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

Please see image below:

enter image description here

Solution 13 - Php

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.

Solution 14 - Php

You can copy these files from template "blog" laravel

enter image description here

Solution 15 - Php

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

Solution 16 - Php

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

Solution 17 - Php

  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.

Solution 18 - Php

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.

Solution 19 - Php

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjemzView Question on Stackoverflow
Solution 1 - Phpkylehyde215View Answer on Stackoverflow
Solution 2 - PhpTausif AnwarView Answer on Stackoverflow
Solution 3 - PhpYosephView Answer on Stackoverflow
Solution 4 - PhpRahul HirveView Answer on Stackoverflow
Solution 5 - PhpEthicalguy Gopal BogatiView Answer on Stackoverflow
Solution 6 - PhppavaniView Answer on Stackoverflow
Solution 7 - Phpkonstantin shevchenkoView Answer on Stackoverflow
Solution 8 - PhplightupView Answer on Stackoverflow
Solution 9 - Phpuser7762065View Answer on Stackoverflow
Solution 10 - PhpNadimuthu SarangapaniView Answer on Stackoverflow
Solution 11 - PhpNava BogateeView Answer on Stackoverflow
Solution 12 - PhpmaqsView Answer on Stackoverflow
Solution 13 - PhpHitendra Singh ShekhawatView Answer on Stackoverflow
Solution 14 - Phptandry syawaludinView Answer on Stackoverflow
Solution 15 - Phpuser889030View Answer on Stackoverflow
Solution 16 - PhpHari PudyalView Answer on Stackoverflow
Solution 17 - PhpNasir KhanView Answer on Stackoverflow
Solution 18 - PhpAlexander AbreuView Answer on Stackoverflow
Solution 19 - PhpEmmanuel Iyen-MediatreesView Answer on Stackoverflow