jwt-auth
jwt-auth copied to clipboard
PHP 8.0 Compatibility
PHP 8.0 is not supported.
Output from Composer:
Problem 1
- lcobucci/jwt is locked to version 3.3.3 and an update of this package was not requested.
- lcobucci/jwt 3.3.3 requires php ^5.6 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement.
Problem 2
- tymon/jwt-auth is locked to version 1.0.2 and an update of this package was not requested.
- tymon/jwt-auth 1.0.2 requires php ^5.5.9|^7.0 -> your php version (8.0.0) does not satisfy that requirement.
Yes. Also waiting for an update because I have another dependency which uses "lcobucci/jwt": "^3.4 || ^4.0"
. Workarounds from closed issues (like this https://github.com/tymondesigns/jwt-auth/issues/2079) do not help
I can see PHP 8 was added to composer.json, when can we expect that release?
@tymondesigns any plans to support php8?
good evening, do you have any news?
please, can we have any update on that ?
Hi all, I have the same issue. Would be appreciated for PHP 8 support
Guys, install the dev-develop / 1.0.x-dev package with composer, it has suport for php: ^7.2|^8.0;
I was able to get it to work on the last version of Lumen and PHP 8 with audit.
Guys, install the dev-develop / 1.0.x-dev package with composer, it has suport for php: ^7.2|^8.0;
I was able to get it to work on the last version of Lumen and PHP 8 with audit.
This doesn't help if you have lcobucci/jwt
with higher minimum version as dependency in other package
dev-develop
doesn't work because the lcobucci/jwt
package is locked to <3.4
, which does not support PHP 8. It needs to go to at least 4.0.0
It looks like the dev version works, is there anything that we can we do to help get a tagged release?
I would say these two version constraints conflict with each other, so either drop PHP 8 support and keep lcobucci/jwt:<3.4
or promote lcobucci/jwt
to ^4.0
or ^4.1
. Note that this would affect the PHP7 version constraint from ^7.2
to ^7.4
as a workaround I've sidestepped this with --ignore-platform-reqs
and I've not noticed any breakages in my application
Has anyone managed to get this working with PHP8.x, and Laravel 8.x. I'm using Laravel Passport 10.x and having issues speicifically with this at the moment.
Tried using #dev-develop
, -W
, --ignore-platform-reqs
. All we're getting is conflicts and errors.
Considering this is the JWT package within the Laravel and PHP community at the moment, it's embarassing that it's gone unresolved for so long with PHP8
@oliversarfas I have it working with PHP8 and Laravel8, the JWT package itself does support PHP8 in it's latest releases: https://packagist.org/packages/lcobucci/jwt "lcobucci/jwt": "^4.1.4",
Edit - It has supported PHP8 since 2020-11-25
@oliversarfas I have it working with PHP8 and Laravel8, the JWT package itself does support PHP8 in it's latest releases: https://packagist.org/packages/lcobucci/jwt
"lcobucci/jwt": "^4.1.4",
Edit - It has supported PHP8 since 2020-11-25
That's the lcobucci package, not this one. We need a php8 tagged release
related to https://github.com/tymondesigns/jwt-auth/issues/2103
Is there any update on this?
Any updates? Develop seems to support it.
@yuyuan20 @atymic There is a working fork of the project here https://github.com/PHP-Open-Source-Saver/jwt-auth They started to keep the project alive. A long discussion about it is here #2145 I am using the new package in one of my projects and it works perfectly, just it doesn't have a release version yet. They are now moving the pull request to the new repository, like #2111
@yuyuan20 @atymic There is a working fork of the project here https://github.com/PHP-Open-Source-Saver/jwt-auth They started to keep the project alive. A long discussion about it is here #2145 I am using the new package in one of my projects and it works perfectly, just it doesn't have a release version yet. They are now moving the pull request to the new repository, like #2111
Just to update everyone who enters this thread:
- We already migrated all the relevant pull requests.
- We fixed some issues in tests.
- We set up to 7.4^ PHP versions.
And the work keeps in progress.
Observation: I'm using this package in production without issues.
If I am trying to deploy my code from Github via Code Pipeline using Elastic Beanstalk (AWS). My question is where and how do I place --ignore-platform-reqs
? I thought that this may go into the .ebxtensions file within the github-deploy.config file, but my deployment continues to fail. A snippet of eb logs below:

p.s. i deleted the composer.lock file and "tymon/jwt-auth": "dev-develop",
within the composer .json file for troubleshooting purposes and I am still getting this error.
github-deploy.config script is as follows:

Any help here would be greatly appreciated. All of our deployments have been failing.
You have to add it in the part not visible in your screenshots (btw: please no screenshots if it's just text only, makes it harder to work with).
The command which, according to your first screenshot, runs /bin/sh -c composer.phar install --no-ansi --no-interaction
needs to have this flag. You added it to the self-update
where, I think, it's a no-op and probably should not even be accepted.
But I strongly urge to not use this flag: if you don't know 150% what you are doing, don't use it: you will run into problems eventually in your production environment.
Rather, switch to https://github.com/PHP-Open-Source-Saver/jwt-auth which is a (mostly) drop-in and supports all recent PHP version and 8+ properly.
You have to add it in the part not visible in your screenshots (btw: please no screenshots if it's just text only, makes it harder to work with).
The command which, according to your first screenshot, runs
/bin/sh -c composer.phar install --no-ansi --no-interaction
needs to have this flag. You added it to theself-update
where, I think, it's a no-op and probably should not even be accepted.But I strongly urge to not use this flag: if you don't know 150% what you are doing, don't use it: you will run into problems eventually in your production environment.
Rather, switch to https://github.com/PHP-Open-Source-Saver/jwt-auth which is a (mostly) drop-in and supports all recent PHP version and 8+ properly.
Huge thanks for your response this helped and worked! (sorry bout the screenshots will make sure not to do that again). Thanks again.
Solved "lcobucci/jwt" version issue with php8 and laravel 8+
Basically this problem occur when you declare type in veriable (like: protected string $user_name) or other and try to access from postman because "lcobucci/jwt" is related to token.
My laravel version is 8+ and when i run composer update
i get this error
Problem 1 - lcobucci/jwt[3.4.0, ..., 3.4.x-dev] require php ^5.6 || ^7.0 -> your php version (8.0.8) does not satisfy that requirement. - Root composer.json requires lcobucci/jwt 3.4.* -> satisfiable by lcobucci/jwt[3.4.0, ..., 3.4.x-dev].
And
To enable extensions, verify that they are enabled in your .ini files: - /etc/php/8.0/cli/php.ini - /etc/php/8.0/cli/conf.d/10-mysqlnd.ini ........ .........
Solution Process I am also updated my "lcobucci/jwt" version to "lcobucci/jwt": "4.0.0"
Then i run:
sudo apt-get install php-gd
sudo apt-get install php-intl
sudo apt-get install php-mbstring
And finally run :
sudo apt-get install php-xml
and my problem solved. You can try and hope this will solve your problem.
Just update your "lcobucci/jwt" version to "lcobucci/jwt": "4.0.0".
My case was that and just updating solved the issue on the first that we implemented. But I'm using docker environment so everything on my local machine, production, and UAT are the same.
try this -> composer require tymon/jwt-auth:*
The best option is migrate to PHP-Open-Source-Saver/jwt-auth
because it is compatible with tymon/jwt-auth
I to solve this issue i'm firstly install this library composer require spomky-labs/lexik-jose-bridge:">=3.0.2" web-token/jwt-signature-algorithm-rsa php-http/httplug-bundle php-http/curl-client nyholm/psr7 php-http/cache-plugin annotations