Error: No Application Encryption Key has been Specified in Laravel 5
production.ERROR: No application encryption key has been specified. {"exception":"[object] (RuntimeException(code: 0): No application encryption key has been specified. at ../vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:42)
This Error usually across on the fresh installations of Laravel, You might have came across this issue on
- Fresh Laravel Installation on Local
- Cloned a Repository
- Hosted your Laravel Project on Server.
Most like the application have a Application Encryption key set. Thus we need to generate a fresh Application Encryption key.
You can easily solve this error by running artisan key:generate command on your terminal at project root directory.
Use coupon 5balloons on this Cloudways Affiliate URL to get special discount.
php artisan key:generate
This command should generate a key file in your .env
file located at the project root.
If you don’t yet have a .env
file at your project root then you should create one by copying the contents of file .env.example
Once you have created the .env file, run the command again and make sure that there is a key generated at property APP_KEY
in the file.
After this run the following commands to clear the cache.
php artisan config:clear
php artisan confg:cache
Try accessing the application again, It should work without “No application encryption key” Error