Laravel: No application encryption key has been specified

Programming

I've installed a new Laravel application on my local machine and now I get the following error when running php artisan serve. This error is shown in my browser.

RuntimeException
No application encryption key has been specified.

 

PHP Software Question created: 2020-08-02 08:25 cleaner

4

Before using Laravel / Laravel's encrypter, you must set a key option in your config/app.php configuration file. Can can achieve this by running the following command in your command line interface:

1) Run this command in your command line interface:

php artisan key:generate 

2) This command above will generate a key which will be automatically set in your .env file:

APP_KEY=base64:fpx9YL3dTKjQfUcKiGUeC+IwhrLu3ZYzIG/yAKkZ4Gw=

3) Once you have run the command the error message should disappear. The generated key will be used in the config/app.php file.

answered 2020-08-02 08:30 MelCodeson

2

Simply run this command which will generate the app key:

php artisan key:generate
answered 2020-08-04 09:50 darkOrbit