0

我在安装 Symfony 2.3.7 时遇到依赖问题。这是一个全新的 Symfony 安装,下载 2.3.7,没有 Vendors zip。运行 composer update 进行初始安装。然后将注释包添加到 composer.json 并再次运行 composer update。

composer.json 的 require 部分,

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",
    "doctrine/orm": ">=2.2.3,<2.4-dev",
    "doctrine/doctrine-bundle": "1.2.*",
    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.3.*",
    "symfony/swiftmailer-bundle": "2.3.*",
    "symfony/monolog-bundle": "2.3.*",
    "sensio/distribution-bundle": "2.3.*",
    "sensio/framework-extra-bundle": "2.3.*",
    "sensio/generator-bundle": "2.3.*",
    "incenteev/composer-parameter-handler": "~2.0",
    "friendsofsymfony/comment-bundle": "2.0.5"
},

以及来自“php composer.phar update”的错误

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
    - Conclusion: remove symfony/symfony v2.3.7
    - Conclusion: don't install symfony/symfony v2.3.7
    - Conclusion: don't install symfony/symfony v2.3.6
    - Conclusion: don't install symfony/symfony v2.3.5
    - Conclusion: don't install symfony/symfony v2.3.4
    - Conclusion: don't install symfony/symfony v2.3.3
    - Installation request for friendsofsymfony/comment-bundle 2.0.5 -> satisfiable by friendsofsymfony/comment-bundle[v2.0.5].
    - Conclusion: don't install symfony/symfony v2.3.2
    - Conclusion: don't install symfony/symfony v2.3.1
    - friendsofsymfony/comment-bundle v2.0.5 requires symfony/symfony >=2.1,<2.3-dev -> satisfiable by symfony/symfony[v2.1.0, v2.1.1, v2.1.10, v2.1.11, v2.1.12, v2.1.13, v2.1.2, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, v2.1.8, v2.1.9, v2.2.0, v2.2.1, v2.2.10, v2.2.2, v2.2.3, v2.2.4, v2.2.5, v2.2.6, v2.2.7, v2.2.8, v2.2.9].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.0].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.1].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.10].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.11].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.12].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.13].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.2].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.3].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.4].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.5].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.6].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.7].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.8].
    - Can only install one of: symfony/symfony[v2.3.0, v2.1.9].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.0].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.1].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.10].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.2].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.3].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.4].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.5].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.6].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.7].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.8].
    - Can only install one of: symfony/symfony[v2.3.0, v2.2.9].
    - Installation request for symfony/symfony 2.3.* -> satisfiable by symfony/symfony[v2.3.0, v2.3.1, v2.3.2, v2.3.3, v2.3.4, v2.3.5, v2.3.6, v2.3.7].
4

3 回答 3

2

我认为这里有问题,你有 symfony > 2.3,但评论需要 < 2.3

friendsofsymfony/comment-bundle v2.0.5 requires symfony/symfony >=2.1,<2.3-dev

尝试安装此版本的评论

"friendsofsymfony/comment-bundle": "2.0.*@dev"

在composer.json中使用此标志(不需要,强制所有依赖项开发最后一个开发版本)

"minimum-stability": "dev"
于 2013-11-26T07:23:17.767 回答
1

前两行解释了一切:

Friendsofsymfony/comment-bundle v2.0.4 需要 jms/serializer 1.0.*@dev -> 找不到匹配的包。

看看你的作曲家,json,你有 0.13。@dev,不是 1.0。@dev

symfony/framework-bundle 2.0.7 需要 symfony/translator 2.0.7 -> 找不到匹配的包。

查看您的 composer.json,您安装的是 2.3.*,而不是 2.0。

我认为您尝试安装旧版本的 foscommentbundle 和旧版本的 jms 序列化程序包。

于 2013-11-24T08:08:23.753 回答
-1

删除行 "jms/serializer-bundle": "1.0.@dev" 并运行composer update。这将删除任何旧版本的序列化程序。之后,您可以稍后添加 "jms/serializer-bundle": "0.13.*@dev" 如果需要。

于 2013-11-29T12:59:27.537 回答