【问题标题】:When trying to install php-jwt facing trouble with auth0尝试安装 php-jwt 时遇到 auth0 问题
【发布时间】:2017-07-20 20:17:26
【问题描述】:

我正在尝试安装 php-jwt。当我输入以下命令时

composer require firebase/php-jwt

它给出了以下错误。

    Using version ^4.0 for firebase/php-jwt
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - auth0/auth0-php 4.0.12 requires firebase/php-jwt ^3.0 -> satisfiable by firebase/php-jwt[v3.0.0] but these conflict with your requirements or minimum-stability.
    - auth0/auth0-php 4.0.12 requires firebase/php-jwt ^3.0 -> satisfiable by firebase/php-jwt[v3.0.0] but these conflict with your requirements or minimum-stability.
    - auth0/auth0-php 4.0.12 requires firebase/php-jwt ^3.0 -> satisfiable by firebase/php-jwt[v3.0.0] but these conflict with your requirements or minimum-stability.
    - Installation request for auth0/auth0-php (locked at 4.0.12, required as ~4.0) -> satisfiable by auth0/auth0-php[4.0.12].


Installation failed, reverting ./composer.json to its original content.

为了便于理解,请在此处提供屏幕截图。

我已经尝试了很多,但找不到任何好的解决方案。

【问题讨论】:

    标签: php composer-php jwt auth0


    【解决方案1】:

    那是因为您正在尝试安装最新版本的 php-jwt,即:4.0,如 packagist.org 所示。

    同时这是另一个软件包 - 似乎是 auth0 正在使用旧版本的 php-jwt 3.0,因此您必须安装 php-jwt 和 3.0 版本,如下所示:

    composer require firebase/php-jwt:^3.0
    

    将您的auth0 包更新到使用php-jwt 的最新主要版本的最新版本,如here: 所示

    "firebase/php-jwt" : "^4.0"
    

    注意:不要忘记在更新包之前备份您的项目。

    【讨论】:

    • 非常好的和详尽的答案,但呈现简单。实际上答案在作曲家抛出的错误消息中。由于我是 auth0 和 php-jwt 的新手,这就是为什么认为它非常复杂。不过谢谢你的回答。
    • 它对我有用。
    猜你喜欢
    • 2020-06-28
    • 1970-01-01
    • 2012-04-17
    • 2020-08-01
    • 2022-09-28
    • 2020-09-29
    • 2019-10-23
    • 2021-11-24
    • 2012-01-22
    相关资源
    最近更新 更多