供应商/lcobucci/jwt/src/Configuration.php上的Laravel 8错误 [英] Laravel 8 error on vendor/lcobucci/jwt/src/Configuration.php

查看:261
本文介绍了供应商/lcobucci/jwt/src/Configuration.php上的Laravel 8错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

语法错误,意外的解析器"(T_STRING),期望函数(T_FUNCTION)或const(T_CONST)","exception":"ParseError",供应商/lcobucci/jwt/src/Configuration.php",行":22

我已经安装了PHP 8.0和composer v2.0.

该项目完美地使用xampp在本地工作,但在Ubuntu 20.04,Digtalocean上的nginx配置中显示了此错误

解决方案

我有完全相同的错误,导致500个内部服务器错误.

通过在我的 composer.json 中添加"lcobucci/jwt":"^ 3.3.3" 来解决此问题.

主要是依赖问题,首先我在 composer.json 中将laravel/passport的等级从10.1降级到10.0和我的laravel/framework从8.22.1到8.21.0一样,当时效果还不错.

 <代码>vm:〜$ php -vPHP 7.4.13(CLI)(建立:2020年11月28日06:24:43)(NTS)版权所有(c)PHP组Zend Engine v3.4.0,版权所有(c)Zend TechnologiesZend Technologies的Zend OPcache v7.4.13,版权所有(c) 

我的 composer.json 现在看起来像这样,

 <代码>"laravel/framework":"^ 8.14","laravel/passport":"^ 10.1","lcobucci/jwt":"^ 3.3.3", 

 <代码>您的要求无法解决为一组可安装的软件包.问题1-结论:请勿安装laravel/passport v10.1.0-laravel/passport ^ 10.1的安装请求->laravel/passport [10.x-dev,v10.1.0]可以满足要求.-结论:删除lcobucci/jwt 3.3.3-laravel/passport 10.x-dev需要lcobucci/jwt ^ 3.4 | ^ 4.0->lcobucci/jwt [3.4.x-dev,4.0.x-dev,4.1.x-dev]可满足要求.-只能安装以下之一:lcobucci/jwt [3.4.x-dev,3.3.3].-只能安装以下之一:lcobucci/jwt [4.0.x-dev,3.3.3].-只能安装以下之一:lcobucci/jwt [4.1.x-dev,3.3.3].-对于lcobucci/jwt 3.3.3的安装请求.lcobucci/jwt [3.3.3]可以满足. 

已添加

 更新依赖关系(包括require-dev)软件包操作:安装0次,更新4次,删除0次-更新lcobucci/jwt(3.3.3 => 3.4.2):从缓存加载-更新联赛/oauth2-服务器(8.1.1 => 8.2.4):从缓存加载-更新laravel/framework(v8.21.0 => v8.22.1):从缓存加载-更新laravel/passport(v10.0.0 => v10.1.0):从缓存加载 

现在一切正常,您可以在这里找到更多详细信息

syntax error, unexpected 'Parser' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)", "exception": "ParseError", vendor/lcobucci/jwt/src/Configuration.php", "line": 22

I have PHP 8.0 and composer v2.0 installed.

The project work locally using xampp perfectly but showing this error in Ubuntu 20.04, nginx config on Digtalocean

解决方案

I had the same exact err, causing a 500 internal server error.

by adding "lcobucci/jwt": "^3.3.3" to my composer.json fixed the issue.

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.


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,


"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

这篇关于供应商/lcobucci/jwt/src/Configuration.php上的Laravel 8错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆