September 1, 2017 • 1 minute read
Fixing RuntimeException No application encryption key has been specified error
A common issue you might experience when working on a Laravel application is the exception:
RuntimeException No application encryption key has been specified.
You'll often run into this when you pull down an existing Laravel application, where you copy the .env.example
file to .env
but don't set a value for the APP_KEY
variable.
Fixing this is very straightforward. At the command line, issue the following Artisan command to generate a key:
$ php artisan key:generate
This will generate a random key, add to it your .env
file and you should no longer see the error message.