symfony 无法识别“lexik_jwt_authentication.API_platform”下的选项“enabled”

xoefb8l8  于 2023-10-24  发布在  其他
关注(0)|答案(1)|浏览(93)

我在初始化一个新的symfony项目时遇到了一个问题。它似乎显示了api-plaform和lexik jwt bundle之间的冲突。
首先,我用这个命令创建一个新的项目:

symfony new <my-project>  ( or composer create command )

然后安装api-plaform:

composer require api

最后我设置了lexik:

composer require composer require lexik/jwt-authentication-bundle

不幸的是,我总是得到这个错误,而缓存清理:
在ArrayNode.php行327:
!!
!!无法识别的选项“enabled”,位于
“lexik_jwt_authentication.API_platform”。可用选项包括
“check_path”、“password_path”、“username_path”。
这是我的composer.json文件:

{
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "stable",
    "prefer-stable": true,
    "require": {
        "php": ">=8.1",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "api-platform/core": "^3.1",
        "doctrine/doctrine-bundle": "^2.10",
        "doctrine/doctrine-migrations-bundle": "^3.2",
        "doctrine/orm": "^2.16",
        "lexik/jwt-authentication-bundle": "^2.18",
        "nelmio/cors-bundle": "^2.3",
        "phpdocumentor/reflection-docblock": "^5.3",
        "phpstan/phpdoc-parser": "^1.23",
        "symfony/asset": "6.3.*",
        "symfony/console": "6.3.*",
        "symfony/dotenv": "6.3.*",
        "symfony/expression-language": "6.3.*",
        "symfony/flex": "^2",
        "symfony/framework-bundle": "6.3.*",
        "symfony/property-access": "6.3.*",
        "symfony/property-info": "6.3.*",
        "symfony/runtime": "6.3.*",
        "symfony/security-bundle": "6.3.*",
        "symfony/serializer": "6.3.*",
        "symfony/twig-bundle": "6.3.*",
        "symfony/validator": "6.3.*",
        "symfony/yaml": "6.3.*"
    },
    "config": {
        "allow-plugins": {
            "php-http/discovery": true,
            "symfony/flex": true,
            "symfony/runtime": true
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php73": "*",
        "symfony/polyfill-php74": "*",
        "symfony/polyfill-php80": "*",
        "symfony/polyfill-php81": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "6.3.*"
        }
    }
}

我无法解释这种功能障碍...

kg7wmglp

kg7wmglp1#

我终于在这里找到了解决办法:
https://github.com/lexik/LexikJWTAuthenticationBundle/issues/1152
我们需要在php.ini文件中启用钠扩展名。
lcobucci/jwt 5.0.0需要这个。

相关问题