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

时间:2019-03-04 13:28:44

标签: composer-php symfony-2.8 php-5.4

我正在尝试通过作曲家初始化我的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"
    },
    ...
}

如何解决这些错误?

1 个答案:

答案 0 :(得分:0)

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

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