【问题标题】:Laravel 5.4 route list exceptionLaravel 5.4 路由列表异常
【发布时间】:2017-12-17 17:29:06
【问题描述】:

我正在尝试使用 artisan 命令 php artisan route:list 列出所有路由列表

我收到以下错误,

[ErrorException]
  You must set the encryption key going forward to improve the security of this library - see this page for more info
  rmation https://oauth2.thephpleague.com/v5-security-improvements/

【问题讨论】:

  • 您是否正确生成了应用程序密钥?
  • 我认为您的应用程序密钥无效,请运行php artisan key:generate 命令生成新密钥
  • 首先我更新了作曲家然后我跑了php artisan key:generate
  • @RAUSHAN KUMAR @Sagar Gautam 即使我做了composer dump-autoload,但我仍然遇到同样的错误

标签: php laravel laravel-5.4 laravel-routing


【解决方案1】:

根据最新的oauth-server 5.1.4更新,您应该在passport 2.x中设置一个尚未实现的加密密钥。

一个简单快速的解决方法是使用passport 3.x,它使用oauth-server 6.x,通过更新你的composer.json文件:

"laravel/passport": "^3.0"

然后

composer update

或者,试试

sudo chown www-data:www-data storage/oauth-*.key
sudo chmod 600 storage/oauth-*.key

也许它可以解决你的问题。

【讨论】:

  • 谢谢你的回复,我用的是windows,命令是什么
  • 谢谢你的工作,但我收到了一个新错误[Symfony\Component\Debug\Exception\FatalErrorException] syntax error, unexpected '}' 我无法确定错误在我的路线文件中的位置
  • @MrRobot 检查 routes.php,我想你添加了一个额外的右括号}
  • 我确实重构了我的routes.php 我正在获取所有数据和东西。我只有在运行 php artisan route:list 命令时才收到错误
  • 你拯救了我的一天..!
猜你喜欢
  • 2017-09-20
  • 2017-06-29
  • 1970-01-01
  • 2018-04-15
  • 2018-05-02
  • 2018-02-26
  • 2020-11-08
  • 1970-01-01
  • 2018-04-15
相关资源
最近更新 更多