phplaravellaravel-5.7

php artisan key:generate doesn't do anything


I tried previous questions and answers before in SO, but nothing solves my problem.

  1. I clone a new project in my Mac. Then composer update.

  2. Everything is ok so far. But when i manually create .env file via touch .env

  3. and type php artisan key:generate. Nothing happens. Absolutely nothing. No error and .env is blank as it was before. I had the same error. I tried applying sudo, nothing happens. It just says: Application key set successfully.

How to solve this problem?


Solution

  • @Touhidul Islam You have to copy .env.example file and rename it to .env then run php artisan key:generate command