简体   繁体   中英

PHP artisan key:generate does not update .env file (laravel 5.2 on AWS EC2 Ubuntu)

I renamed my example.env to .env in order to remove previous errors with my application. However, I noticed

APP_KEY=SomeRandomString

near the top of the .env file an new something was off. When I run

PHP artisan key:generate and recheck the .env file...nothing happens.

My stack includes Apache2, Ubuntu Server 14.04 LTS (HVM), PHP 5.5.36

看起来Laravel仍然使用旧的.env文件,即使该文件已被删除,也可以尝试使用php artisan optimize .env优化类加载php artisan optimize然后重新生成密钥。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM