3

尝试通过 Composer 安装教义/mongodb-odm 我得到了这个:

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 1.0.x-dev requires ext-mongo >=1.2.12,<1.4-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.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-BETA3 requires ext-mongo >=1.3.1,<1.4-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.0-BETA2 requires ext-mongo >=1.2.12,<1.3-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.0-BETA1 requires ext-mongo * -> 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.
    - Installation request for doctrine/mongodb 1.0.*@dev -> satisfiable by doctrine/mongodb 1.0.0, doctrine/mongodb 1.0.0-BETA1, doctrine/mongodb 1.0.0-BETA2, doctrine/mongodb 1.0.0-BETA3, doctrine/mongodb 1.0.1, doctrine/mongodb 1.0.2, doctrine/mongodb 1.0.x-dev.

然而php -m有:

[PHP Modules]
...
mongo
...

并且composer.phar show --platform有:

...
ext-mongo        1.3.5     The mongo PHP extension
...

有任何想法吗?该扩展肯定安装正确,Composer 甚至列出了它。版本(>=1.2.12,<1.4-dev)也符合要求。

4

2 回答 2

1

原来这是 Sublime Text 2 Composer 插件的错。如果我通过终端运行 Coomoser 就可以了。为什么它在 ST2 中不起作用有点神秘,据我所知,它正在执行完全相同的命令:/bin/composer.phar update -n -v.

于 2013-03-19T19:18:51.527 回答
0

如果您将 Mongo 加载到通过 WAMPSERVER 安装的 PHP 实例中,则可能导致此问题的原因是 2 个 php.ini 文件中只有一个被修改path\to\wamp\bin\php\php5\php.ini。如果您添加extension=php_mongo.dllpath\to\wamp\bin\apache\apche2\bin\php.ini您应该能够从命令行或编辑器 cli 工具使用 mongo 函数执行 php。

如果您遇到作曲家错误:

doctrine/mongodb 1.0.x-dev requires ext-mongo >=1.2.12,<1.5-dev -> the requested PHP extension mongo is missing from your system

那么这是您需要更新apache2x\bin\php.ini文件的另一个指标

于 2013-06-09T04:17:07.020 回答