大佬教程收集整理的这篇文章主要介绍了供应商/lcobucci/jwt/src/Configuration.php 上的 Laravel 8 错误,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
语法错误,意外的“解析器”(T_StriNG),需要函数(T_FUNCTION)或常量(T_CONST)”,“异常”:“ParseError”,vendor/lcobucci/jwt/src/Configuration.php”, “行”:22
我安装了 php 8.0 和 composer v2.0。
该项目在本地使用 xampp 完美运行,但在 Ubuntu 20.04、Digtalocean 上的 Nginx 配置中显示此错误
我有同样的错误,导致 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
以上是大佬教程为你收集整理的供应商/lcobucci/jwt/src/Configuration.php 上的 Laravel 8 错误全部内容,希望文章能够帮你解决供应商/lcobucci/jwt/src/Configuration.php 上的 Laravel 8 错误所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。