If .env is removed on my Laravel project the command
$ php artisan key:generate
Causes this error
ErrorException : file_get_contents(/folder/projectlocation/.env): failed to open stream: No such file or directory at //folder/projectlocation/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())
));
}
However the php artisan serve
command works "Laravel development server started: <http://127.0.0.1:8000>"
I have cleared all the Laravel caches. Why will it serve but not fetch the .env file configuration?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…