I'm new to Laravel and I'm trying to use the Artisan command...
php artisan serve
It displays...
Laravel development server started: http://127.0.0.1:8000
However, it won't automatically launch and when I manually enter http://127.0.0.1:8000 it shows this error:
RuntimeException No application encryption key has been specified.
Any ideas? I'm using Laravel framework 5.5-dev.
Okay, I'll write another instruction, because didn't find the clear answer here. So if you faced such problems, follow this:
That's it.
cp .env.example .env
if there is no .env file present.php artisan key:generate
command works for me. It generates the encryption keyRun the command
php artisan key:generate
it will generate Application Key for your application. You can find the application key(APP_KEY) in.env
file.Copy
.env.example
to.env
:cp -a .env.example .env
Generate a key:
php artisan key:generate
Only then run:
php artisan serve
worked for me, but it had to be done in a command prompt on Windows.
Doing it inside the terminal in PHPStorm didn't worked.
From Encryption - Laravel - The PHP Framework For Web Artisans:
I found that using this complex internet query in google.com:
"laravel add encrption key" (Yes, it worked even with the typo!)