Home > Software engineering >  laravel 7 artisan key:generate not working
laravel 7 artisan key:generate not working

Time:10-24

when i run php artisan key:generate in cmd it's return

file_get_contents(/project/positiv/core/vendor/psy//.env): failed to open stream: No such file or directory

at

/project/positiv/core/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php:96
{
    file_put_contents($this->laravel->environmentFilePath(), preg_replace(
        $this->keyReplacementPattern(),
        'APP_KEY='.$key,
        file_get_contents($this->laravel->environmentFilePath())
    ));
}

I am trying to generate APP_KEY!!!

CodePudding user response:

At first generate APP_KEY with the command php artisan key:generate --show. It will print contents on your terminal which you can copy and paste wherever you want. In this case APP_KEY=value on your .env file.

Generated Key format will be someht base64:xxxxxxxxxxxxxxxxxxxxxxx.

CodePudding user response:

It seems you are trying to run artisan command outside the project.

Make sure your terminal is tergeting to the exact project you want to trigger

  • Related