Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SimonAngatia's avatar

php artisan key:generate runs successfully but no key is generated PHP 7.4.9

I just pulled my project from GitHub with an intention of working on it but then when I run PHP artisan serve after doing composer install, PHP artisan config: cache and making sure that I have the .env file in the root directory, the command runs successfully but no key is generated. A quick search gives me solutions such as making sure I have a .env file, I do PHP artisan config: clear/cache, I do composer update --no-scripts etc. I have done all those but then realized again that it might be an error with PHP 7.4 from this post on GitHub: https://github.com/laravel/framework/issues/32059

Could anyone suggest possible solutions to this problem?

0 likes
2 replies
Sinnbeck's avatar

Run php artisan key:generate --show and copy the result into the .env manually

APP_KEY=TheKey
Snapey's avatar

don't run config:cache in development (ever)

run artisan config:clear then artisan key:generate

Please or to participate in this conversation.