Posted in PHP onApril 02, 2019
本文实例讲述了Laravel框架运行出错提示RuntimeException No application encryption key has been specified.解决方法。分享给大家供大家参考,具体如下:
①在项目根目录放置.env文件
.env APP_NAME=Laravel APP_ENV=local APP_KEY= APP_DEBUG=true APP_LOG_LEVEL=debug APP_URL=http://localhost DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret BROADCAST_DRIVER=log CACHE_DRIVER=file SESSION_DRIVER=file SESSION_LIFETIME=120 QUEUE_DRIVER=sync REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET=
②在项目目录下运行:
php artisan key:generate
该命令会生成APP_KEY并写入到.env文件中,重新运行
希望本文所述对大家基于Laravel框架的PHP程序设计有所帮助。
Laravel框架运行出错提示RuntimeException No application encryption key has been specified.解决方法
- Author -
墨也声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@