【问题标题】:ZF2 dependency issues during installationZF2 安装过程中的依赖问题
【发布时间】:2017-01-01 17:15:54
【问题描述】:

我正在 ZF2 中创建的本地环境中建立一个网站。克隆代码后,我运行composer install 并遇到错误。试图寻找一些可能有帮助的答案,但我发现没有一个对我有用,最后把它贴在这里。以下是我遇到的错误:

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
    - Installation request for zf-commons/zfc-user-doctrine-orm dev-master -> satisfiable by zf-commons/zfc-user-doctrine-orm[dev-master].
    - zf-commons/zfc-user-doctrine-orm dev-master requires doctrine/doctrine-orm-module ~1.0 -> satisfiable by doctrine/doctrine-orm-module[1.0.0] but these conflict with your requirements or minimum-stability.
  Problem 2
    - don't install zendframework/zend-validator 2.8.1|don't install zendframework/zendframework 2.3.0
    - don't install zendframework/zend-validator 2.8.1|don't install zendframework/zendframework 2.3.1
    - don't install zendframework/zend-validator 2.8.1|don't install zendframework/zendframework 2.3.2
    - don't install zendframework/zend-validator 2.8.1|don't install zendframework/zendframework 2.3.3
    - don't install zendframework/zend-validator 2.8.1|don't install zendframework/zendframework 2.3.4
    - don't install zendframework/zend-validator 2.8.1|don't install zendframework/zendframework 2.3.5
    - don't install zendframework/zend-validator 2.8.1|don't install zendframework/zendframework 2.3.6
    - don't install zendframework/zend-validator 2.8.1|don't install zendframework/zendframework 2.3.7
    - don't install zendframework/zend-validator 2.8.1|don't install zendframework/zendframework 2.3.8
    - don't install zendframework/zend-validator 2.8.1|don't install zendframework/zendframework 2.3.9
    - doctrine/doctrine-module dev-master requires zendframework/zend-validator ^2.8.1 -> satisfiable by zendframework/zend-validator[2.8.1].
    - Installation request for doctrine/doctrine-module dev-master -> satisfiable by doctrine/doctrine-module[dev-master].
    - Installation request for zendframework/zendframework 2.3.* -> satisfiable by zendframework/zendframework[2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 2.3.9].

我的composer.json 包含:

{
  "name" : "zendframework/skeleton-application",
  "description" : "Skeleton Application for ZF2",
  "require" : {
    "php" : ">=5.3.3",
    "zendframework/zendframework" : "2.3.*",
    "zendframework/zend-developer-tools" : "dev-master",
    "zf-commons/zfc-user" : "1.*",
    "doctrine/doctrine-module" : "dev-master",
    "doctrine/doctrine-orm-module" : "dev-master",
    "zendframework/zftool" : "dev-master",
    "zf-commons/zfc-user-doctrine-orm" : "dev-master",
    "beberlei/DoctrineExtensions" : "1.0"
  },

  "keywords" : [ "framework", "zf2" ],
  "license" : "BSD-3-Clause",
  "homepage" : "http://framework.zend.com/"
}

尝试更改版本,但似乎无法找到正确的版本。任何帮助将不胜感激。

更新:
应用@al-fonce 建议的更改后,错误减少为:

Problem 1
    - Installation request for doctrine/doctrine-orm-module 0.8.* -> satisfiable by doctrine/doctrine-orm-module[0.8.0].
    - doctrine/doctrine-orm-module 0.8.0 requires doctrine/doctrine-module 0.8.* -> satisfiable by doctrine/doctrine-module[0.8.0, 0.8.0-beta1, 0.8.0-beta2, 0.8.1] but these conflict with your requirements or minimum-stability.
  Problem 2
    - Installation request for zf-commons/zfc-user-doctrine-orm dev-master -> satisfiable by zf-commons/zfc-user-doctrine-orm[dev-master].
    - zf-commons/zfc-user-doctrine-orm dev-master requires doctrine/doctrine-orm-module ~1.0 -> satisfiable by doctrine/doctrine-orm-module[1.0.0] but these conflict with your requirements or minimum-stability.

谢谢!

【问题讨论】:

    标签: php zend-framework2 composer-php


    【解决方案1】:

    您使用了某些模块的dev-master 版本,这需要您使用的 Zend 框架的更高版本。 Doctrine2 dev-master 版本是 Zend Framework 2.3 的最新版本。对于我的 ZF2.5 网站上的 Doctrine2,我使用

    "zendframework/zendframework": "~2.5",
    "doctrine/doctrine-orm-module": "~1.0"
    

    对于一个旧的 Zend Framework 2.3 项目,我使用了 Doctrine 0.8,所以如果 Doctrine 1.0 版不起作用,请尝试:

    "zendframework/zendframework": "~2.3",
    "doctrine/doctrine-orm-module": "0.8.*"
    

    【讨论】:

    • 感谢您的回答,这似乎减少了错误。我现在更新了我的帖子...
    猜你喜欢
    • 2018-11-12
    • 2020-09-29
    • 2017-12-23
    • 1970-01-01
    • 2017-11-08
    • 1970-01-01
    • 2013-11-04
    • 2021-04-17
    • 1970-01-01
    相关资源
    最近更新 更多