简体   繁体   English

Laravel 8 供应商/lcobucci/jwt/src/Configuration.php 错误

[英]Laravel 8 error on vendor/lcobucci/jwt/src/Configuration.php

syntax error, unexpected 'Parser' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)", "exception": "ParseError", vendor/lcobucci/jwt/src/Configuration.php", "line": 22语法错误,意外的 'Parser' (T_STRING),期望 function (T_FUNCTION) 或 const (T_CONST)","异常":"ParseError",vendor/lcobucci/jwt/src/Configuration.php","line":22

I have PHP 8.0 and composer v2.0 installed.我安装了 PHP 8.0 和 composer v2.0。

The project work locally using xampp perfectly but showing this error in Ubuntu 20.04, nginx config on Digtalocean该项目完美地使用 xampp 在本地工作,但在 Digtalocean 上的 Ubuntu 20.04、nginx 配置中显示此错误

I had the same exact err, causing a 500 internal server error.我有同样的错误,导致 500 内部服务器错误。

by adding "lcobucci/jwt": "^3.3.3" to my composer.json fixed the issue.通过添加"lcobucci/jwt": "^3.3.3"到我的composer.json 。json 解决了这个问题。

It's mostly dependencies issue, first I downgraded my laravel/passport from 10.1 to 10.0 in my composer.json and my laravel/framework from 8.22.1 to 8.21.0 as it was working fine at that point.这主要是依赖问题,首先我在我的composer.json和我的 laravel/framework 从 8.22.1 到 8.21.0 中将我的 laravel/passport 从 10.1 降级到 10.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

my composer.json now looks like this,我的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].

added添加


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

Now it's working just fine, you can find more details here现在它工作得很好,你可以在这里找到更多细节

I did composer install --no-plugins and it fixed the error for me.我做了composer install --no-plugins并为我修复了错误。

i had the same problem and fixed it with composer update.我有同样的问题,并用作曲家更新修复了它。 May u try it too.你也可以试试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:Lcobucci\JWT\UnencryptedToken 无法实现 Lcobucci\JWT\Token - 它不是接口 - Error: Lcobucci\JWT\UnencryptedToken cannot implement Lcobucci\JWT\Token - it is not an interface JWT 和 PHP:验证传递的令牌 (Lcobucci\\JWT) - JWT and PHP: Validating a passed token (Lcobucci\JWT) 修复configuration.php后joomla数据库连接错误(2) - joomla Database connection error (2) after fix configuration.php Laravel:目标 [Lcobucci\JWT\Parser] 不可实例化 - Laravel: Target [Lcobucci\JWT\Parser] is not instantiable Joomla 3.4.3 - configuration.php 不可写 - Joomla 3.4.3 - configuration.php not writable Jwt 身份验证错误参数 3 传递给 Lcobucci\JWT\Signer\Hmac::doVerify() - Jwt Authentication error Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() Laravel:第 384 行的 vendor/laravel/framework/src/Illuminate/Support/Arr.php 中的语法错误 - Laravel:syntax error in vendor/laravel/framework/src/Illuminate/Support/Arr.php on line 384 Laravel 护照:Lcobucci\JWT\Token\InvalidTokenStructure 值不是允许的日期格式 - Laravel passport: Lcobucci\JWT\Token\InvalidTokenStructure Value is not in the allowed date format Passport中不存在Lcobucci \\\\ JWT \\\\ Parser类(Laravel 5.6) - Class Lcobucci\\JWT\\Parser does not exist in Passport (Laravel 5.6) Laravel:PHP Parse错误:语法错误,意外'?'在第500行的/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php中 - Laravel: PHP Parse error: syntax error, unexpected '?' in /vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 500
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM