我有同样的错误,导致 500 内部服务器错误。
通过将"lcobucci/jwt": "^3.3.3" 添加到我的composer.json 来解决此问题。
主要是依赖问题,首先我在composer.json 中将 laravel/passport 从 10.1 降级到 10.0
以及我的 laravel/framework 从 8.22.1 到 8.21.0,因为它当时工作正常。
vm:~$ php -v
PHP 7.4.13 (cli) (built: Nov 28 2020 06:24:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
我的composer.json 现在看起来像这样,
"laravel/framework": "^8.14",
"laravel/passport": "^10.1",
"lcobucci/jwt": "^3.3.3",
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install laravel/passport v10.1.0
- Installation request for laravel/passport ^10.1 -> satisfiable by laravel/passport[10.x-dev, v10.1.0].
- Conclusion: remove lcobucci/jwt 3.3.3
- laravel/passport 10.x-dev requires lcobucci/jwt ^3.4|^4.0 -> satisfiable by lcobucci/jwt[3.4.x-dev, 4.0.x-dev, 4.1.x-dev].
- Can only install one of: lcobucci/jwt[3.4.x-dev, 3.3.3].
- Can only install one of: lcobucci/jwt[4.0.x-dev, 3.3.3].
- Can only install one of: lcobucci/jwt[4.1.x-dev, 3.3.3].
- Installation request for lcobucci/jwt 3.3.3 -> satisfiable by lcobucci/jwt[3.3.3].
添加
Updating dependencies (including require-dev)
Package operations: 0 installs, 4 updates, 0 removals
- Updating lcobucci/jwt (3.3.3 => 3.4.2): Loading from cache
- Updating league/oauth2-server (8.1.1 => 8.2.4): Loading from cache
- Updating laravel/framework (v8.21.0 => v8.22.1): Loading from cache
- Updating laravel/passport (v10.0.0 => v10.1.0): Loading from cache
现在一切正常了,你可以找到more details here