user image

Jo Micheal
Published in : 2022-07-16

No application encryption key has been specified. Laravel x9


Hello Guys, 
I am facing this error when I try to run Laravel 9 for the first time

Note: .env was not exists and i created it by myself what should I do?
Thanks in Advance


Mohamed Atef Date : 2022-07-16

Best answers


Best answers


Hello Jo,
That's because you need to add a line called “APP_KEY” and then save the changes of the .env then run 

php artisan key:generate

you will find value added to “APP_KEY”, then clear the application cache using

php artisan optimize


php artisan config:cache

Now run the server using php artisan serve and it will work fine

Jo Micheal Date : 2022-07-16

Thank you so much, it's working!

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

Laravel redirect to the last location after login
Publish date: 2022-02-21 | Comments: 1
How to get original attribute value in Laravel?
Publish date: 2022-02-23 | Comments: 3
Get user location (city - country) from his IP address
Publish date: 2022-03-02 | Comments: 2
Undefined Variable problem on Laravel 9.x
Publish date: 2022-03-06 | Comments: 3
Laravel API POST method returns 419
Publish date: 2022-08-03 | Comments: 1