Laravel不读取.env文件中的配置

时间:2017-04-05 07:08:30

标签: php laravel environment-variables

Laravel不会在env中读取配置,因此env('APP_KEY')始终返回NULL。我也用:

php artisan config:clear

php artisan config:cache

但它没有任何效果。你有解决方案吗?第一次,我可以使用上面的2命令修复,但现在我不能。

1 个答案:

答案 0 :(得分:2)

Try:

php artisan config:clear

then:

php artisan cache:clear

and make sure that you have permissions to run these commands, or you can simply run them with sudo.