Whoops, looks like something went wrong. Laravel 5.0
PhpLaravel 5Php 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.
-
Rename
.env.example
to.env
-
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.
- Go to project folder like "C:\wamp\www\laravel".
- Open the file name of
.env.example
. (By using any editor like sublime, notepad++ and so on). - 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
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
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
- Rename the .env.example to .env
- Go to bootstrap=>app.php and uncomment
$app->withEloquent();
- Make sure that APP_DEBUG=true in .env file. Now it will work.
Solution 18 - Php
This worked for me:
- Go to the
.env
file and be sureAPP_DEBUG=true
- Here (in
.env
file) changereemplace 127.0.0.1
forlocalhost
for check if your DB credential are corrects. - 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