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
3
Answers
I had the same exact err, causing a 500 internal server error.
by adding
"lcobucci/jwt": "^3.3.3"
to mycomposer.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.
my
composer.json
now looks like this,added
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.i had the same problem and fixed it with composer update. May u try it too.