Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.0 Compatibility #2082

Closed
Brenneisen opened this issue Dec 28, 2020 · 28 comments
Closed

PHP 8.0 Compatibility #2082

Brenneisen opened this issue Dec 28, 2020 · 28 comments

Comments

@Brenneisen
Copy link

Brenneisen commented Dec 28, 2020

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.
@rmncv
Copy link

rmncv commented Dec 30, 2020

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 #2079) do not help

@mwleinad
Copy link

I can see PHP 8 was added to composer.json, when can we expect that release?

@sergiy-petrov
Copy link

@tymondesigns any plans to support php8?

@LvcioT
Copy link

LvcioT commented Jan 29, 2021

good evening,
do you have any news?

@michelsouzafigueiredo
Copy link

please, can we have any update on that ?

@korimarik
Copy link

Hi all,
I have the same issue. Would be appreciated for PHP 8 support

@michelsouzafigueiredo
Copy link

Guys, install the dev-develop / 1.0.x-dev package with composer, it has suport for php: ^7.2|^8.0;

Composer package;

I was able to get it to work on the last version of Lumen and PHP 8 with audit.

@rmncv
Copy link

rmncv commented Feb 17, 2021

Guys, install the dev-develop / 1.0.x-dev package with composer, it has suport for php: ^7.2|^8.0;

Composer package;

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

@harrydowe
Copy link

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

@borisson
Copy link

It looks like the dev version works, is there anything that we can we do to help get a tagged release?

@harrydowe
Copy link

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

@oliversarfas
Copy link

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

@devaygun
Copy link

devaygun commented Apr 2, 2021

@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
Copy link

@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

@CodeNinja1337
Copy link

related to #2103

@yuyuan20
Copy link

Is there any update on this?

@atymic
Copy link

atymic commented Sep 29, 2021

Any updates? Develop seems to support it.

@djereg
Copy link

djereg commented Sep 29, 2021

@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

@Messhias
Copy link

@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.

@goinskj
Copy link

goinskj commented Dec 30, 2021

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:

Screen Shot 2021-12-30 at 7 24 24 AM

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:

Screen Shot 2021-12-30 at 7 28 57 AM

Any help here would be greatly appreciated. All of our deployments have been failing.

@mfn
Copy link
Contributor

mfn commented Dec 30, 2021

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.

@goinskj
Copy link

goinskj commented Dec 31, 2021

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.

Huge thanks for your response this helped and worked! (sorry bout the screenshots will make sure not to do that again). Thanks again.

@lokman-hosen
Copy link

lokman-hosen commented Jan 11, 2022

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.

@Messhias
Copy link

Messhias commented Jan 11, 2022

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.

@felipedpaula
Copy link

try this -> composer require tymon/jwt-auth:*

@enniopruvo
Copy link

The best option is migrate to PHP-Open-Source-Saver/jwt-auth because it is compatible with tymon/jwt-auth

@stephenwi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests