通过Composer安装会收到包含某些依赖项的错误

问题描述 投票:0回答:1

我正在尝试通过composer初始化我的symfony项目。但是我得到以下错误:

Problem 1
    - Installation request for pugx/shortid-php 1.* -> satisfiable by pugx/shortid-php[1.0.x-dev].
    - pugx/shortid-php 1.0.x-dev requires php ^7.1 -> your PHP version (5.4.45) does not satisfy that requirement.
Problem 2
    - Installation request for pugx/shortid-doctrine 1.* -> satisfiable by pugx/shortid-doctrine[1.0.x-dev].
    - pugx/shortid-doctrine 1.0.x-dev requires pugx/shortid-php ^0.5 -> satisfiable by pugx/shortid-php[v0.5.0] but these conflict with your requirements or minimum-stability.
Problem 3
    - Installation request for pugx/shortid-doctrine-bundle 1.* -> satisfiable by pugx/shortid-doctrine-bundle[1.0.x-dev].
    - pugx/shortid-doctrine-bundle 1.0.x-dev requires pugx/shortid-doctrine ^0.4 -> satisfiable by pugx/shortid-doctrine[v0.4.0] but these conflict with your requirements or minimum-stability.

我正在使用PHP 5.4

下面我展示了我的composer.json的摘录:

{
    ...

    "autoload": {
        "psr-4": { "": "src/" }
    },
    "require": {
        "php": "^5.4",
        "symfony/symfony": "~2.7",
        "doctrine/orm": "~2.5",
        "doctrine/doctrine-bundle": "~1.4",
        "twig/extensions": "~1.0",
        "pugx/shortid-php": "1.*@dev",
        "pugx/shortid-doctrine": "1.*@dev",
        "pugx/shortid-doctrine-bundle": "1.*@dev",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/framework-extra-bundle": "~3.0",
        "sensio/distribution-bundle": "~4.0",
        "sensio/generator-bundle": "~2.3",
        "jms/serializer": "0.16.0",
        "justinrainbow/json-schema": "^5.2"
    },
    "require-dev": {
        "beelab/test-bundle": "~1.0",
        "doctrine/doctrine-fixtures-bundle": "2.2.*",
        "incenteev/composer-parameter-handler": "~2.0",
        "phpunit/phpunit": "4.*",
        "fabpot/php-cs-fixer": "~1.5"
    },
    "config": {
        "bin-dir": "bin"
    },
    ...
}

我该如何解决这些错误?

composer-php symfony-2.8 php-5.4
1个回答
0
投票

错误消息说明了一切:pugx/shortid-php 1.0.x-dev requires php ^7.1

您需要将项目升级到PHP 7.1或使用与PHP 5.4兼容的版本替换依赖项。

© www.soinside.com 2019 - 2024. All rights reserved.