I have a Laravel application which is working well, but whenever I view the log file there are hundreds of error
production.ERROR: No application encryption key has been specified. {"exception":"[object] (RuntimeException(code: 0): No application encryption key has been specified.
exist in log file. There is a key in .env
file and also I tried php artisan key:generate
command as well but the error still generated in log file without any visible error to users.
This error only appears in the production server's log file, not in my development pc.
php artisan key:generate
This will generate a random key, you must restart the server and you should no longer see the error message.
run the following commands to clear the cache.
php artisan config:clear
php artisan config:cache
I'm face to the same issue I have searched a lot but in a YouTube video comment I have found a solution (I'm not sure this solution is good or not) but worked for me
copy APP_KEY from .env file
and past in app.php file (located in: your_project\config)
Your app.php will look like
.
.
.
‘key’ => env(‘APP_KEY’, ‘base64:insert key here’),
.
.
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With