1

我在 Symfony3 中创建新项目(这是我在 symfony 中的第一个项目)我使用 Windows xampp(php 版本 5.6)。我下载 composer 和 mongodb.dll 文件。我将它添加到 xampp (php.ini) 的扩展中。我添加到 composer.json

"doctrine/mongodb-odm": "~1.0",
"doctrine/mongodb-odm-bundle": "~3.0"

现在我去我的cmd并复制这个comend

  php composer.phar update doctrine/mongodb-odm doctrine/mongodb-odm-bundle

我有错误:

C:\xampp\htdocs\cannabis>php composer.phar update doctrine/mongodb-odm  doctrine/mongodb-odm-bundle
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
- doctrine/mongodb-odm 1.0.0-BETA6 requires doctrine/mongodb >=1.0.0-beta1,<1.1-dev -> satisfiable by doctrine/mongodb[1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9].
- doctrine/mongodb-odm 1.0.0-BETA7 requires doctrine/mongodb 1.0.* -> satisfiable by doctrine/mongodb[1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9].
- doctrine/mongodb-odm 1.0.0-BETA8 requires doctrine/mongodb 1.0.* -> satisfiable by doctrine/mongodb[1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9].
- doctrine/mongodb-odm 1.0.0-BETA9 requires doctrine/mongodb 1.0.* -> satisfiable by doctrine/mongodb[1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9].
- doctrine/mongodb-odm 1.0.0-BETA10 requires doctrine/mongodb >=1.1.5,<2.0 -> satisfiable by doctrine/mongodb[1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.0-BETA11 requires doctrine/mongodb >=1.1.5,<2.0 -> satisfiable by doctrine/mongodb[1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.0-BETA12 requires doctrine/mongodb >=1.1.5,<2.0 -> satisfiable by doctrine/mongodb[1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.0-BETA13 requires doctrine/mongodb >=1.1.5,<2.0 -> satisfiable by doctrine/mongodb[1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.0 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.1 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.2 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.3 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.4 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.5 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.6 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.7 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb-odm 1.0.8 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0].
- doctrine/mongodb 1.0.9 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.8 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.7 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.6 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.5 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.4 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.3 requires ext-mongo >=1.2.12,<1.5-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.2 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.11 requires ext-mongo >=1.2.12,<1.7-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.10 requires ext-mongo >=1.2.12,<1.7-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.1 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.0 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb-odm 1.0.0-BETA5 requires doctrine/mongodb 1.0.0-BETA1 -> satisfiable by doctrine/mongodb[1.0.0-BETA1] but these conflict with your requirements or minimum-stability.
- doctrine/mongodb-odm 1.0.0-BETA4 requires doctrine/mongodb 1.0.0-BETA1 -> satisfiable by doctrine/mongodb[1.0.0-BETA1] but these conflict with your requirements or minimum-stability.
- doctrine/mongodb 1.1.8 requires ext-mongo >=1.2.12,<1.7-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.1.7 requires ext-mongo >=1.2.12,<1.7-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.1.6 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.1.5 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.3.0 requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.2.2 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.2.1 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.2.0 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
- Installation request for doctrine/mongodb-odm 1.0.*@beta -> satisfiable by doctrine/mongodb-odm[1.0.0, 1.0.0-BETA10, 1.0.0-BETA11, 1.0.0-BETA12, 1.0.0-BETA13, 1.0.0-BETA4, 1.0.0-BETA5, 1.0.0-BETA6, 1.0.0-BETA7, 1.0.0-BETA8, 1.0.0-BETA9, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8].

To enable extensions, verify that they are enabled in those .ini files:
- C:\xampp\php\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
4

1 回答 1

1

Doctrine ODM 目前不支持最新的 php_mongodb 扩展,而是必须使用 php_mongo(注意末尾缺少 db)扩展。

或者,要将 php_mongodb 与 Doctrine ODM 一起使用,首先将其升级为使用最新的 dev-master,即

"doctrine/mongodb-odm": "dev-master",
"doctrine/mongodb-odm-bundle": "dev-master"

然后使用https://github.com/alcaeus/mongo-php-adapter

于 2016-10-20T06:35:47.053 回答