Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
195 views
in Technique[技术] by (71.8m points)

php - Laravel ENV无法重新加载(Laravel ENV not reload)

I use LARAVEL 6.2 with valet and PHP 7.3.12.

(我在代客和PHP 7.3.12中使用LARAVEL 6.2。)

The problem is I want to change DB_DATABASE=laravel to DB_DATABASE=something_else in .env but it doesn't reload the new env value at all

(问题是我想改变DB_DATABASE=laravelDB_DATABASE=something_else.env ,但它不会重新加载所有新的ENV值)

I have tried with

(我尝试过)

php artisan config:clear
php artisan config:cache

but it still doesn't change at all.

(但它仍然没有任何改变。)

I even try to add a new key to .env file and query it in tinker and the new key doesn't add as well.

(我什至尝试向.env文件中添加新密钥并在修补程序中对其进行查询,但新密钥也没有添加。)

  ask by Ch.Suparerk translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

首先,我只是重新启动计算机,但它不起作用,然后我执行了php artisan config:cache ,现在可以正常工作了。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...