Reputation: 4442
I tried previous questions and answers before in SO, but nothing solves my problem.
I clone a new project in my Mac. Then composer update
.
Everything is ok so far. But when i manually create .env
file via touch .env
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?
Upvotes: 3
Views: 5579
Reputation: 1045
I have my own settings in .env, so did not want to copy the .env.example file. Simple fix for me - my current .env had a line
APP_KEY = somewrongkey
and
php artisan key:generate
reported success, however it, as above, did not save in .env. The problem was actually the space characters. Changing to
APP_KEY=
Then
php artisan key:generate
Showed a new key in .env
APP_KEY=base64:SgFJ7ClPfCczedxKwiIvQ58ZmMaGDxvOfsTRNfzLYww=
Upvotes: 0
Reputation: 415
@Touhidul Islam You have to copy .env.example
file and rename it to .env
then run php artisan key:generate
command
Upvotes: 5