doubi8965
2013-03-19 17:38
浏览 78

无法使用Composer安装doctrine / mongodb-odm

Trying to install doctrine/mongodb-odm via Composer I get this:

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.

However php -m has:

[PHP Modules]
...
mongo
...

And composer.phar show --platform has:

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

Any ideas? The extension is definitely installed correctly, and Composer even lists it. The version (>=1.2.12,<1.4-dev) meets the requirements as well.

图片转代码服务由CSDN问答提供 功能建议

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

 使用包信息加载编写器存储库
更新依赖项(包括require-dev)
您的需求无法解析为可安装的软件包集。
 
问题1 
  -  doctrine / mongodb 1.0.x-dev 需要ext-mongo&gt; = 1.2.12,&lt; 1.4-dev  - &gt; 您的系统中缺少所请求的PHP扩展名mongo。
  -  doctrine / mongodb 1.0.2需要ext-mongo&gt; = 1.2.12,&lt; 1.4-dev  - &gt; 您的系统中缺少所请求的PHP扩展名mongo。
  -  doctrine / mongodb 1.0.1需要ext-mongo&gt; = 1.2.12,&lt; 1.4-dev  - &gt; 您的系统中缺少所请求的PHP扩展名mongo。
  -  doctrine / mongodb 1.0.0-BETA3需要ext-mongo&gt; = 1.3.1,&lt; 1.4-dev  - &gt; 您的系统中缺少所请求的PHP扩展名mongo。
  -  doctrine / mongodb 1.0.0-BETA2需要ext-mongo&gt; = 1.2.12,&lt; 1.3-dev  - &gt; 您的系统中缺少所请求的PHP扩展名mongo。
  -  doctrine / mongodb 1.0.0-BETA1需要ext-mongo *  - &gt; 您的系统中缺少所请求的PHP扩展名mongo。
  -  doctrine / mongodb 1.0.0需要ext-mongo&gt; = 1.2.12,&lt; 1.4-dev  - &gt; 您的系统中缺少所请求的PHP扩展名mongo。
  -  doctrine / mongodb的安装请求1.0.*@dev  - &gt; 可以理解为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 has:

  ... 
ext-mongo 1.3.5 mongo PHP扩展程序
 ... 
   
 
  

有什么想法吗? 扩展名肯定是正确安装的,Composer甚至会列出它。 版本(&gt; = 1.2.12,&lt; 1.4-dev)也符合要求。

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dseomy1964 2013-03-19 19:18
    已采纳

    Turns out this was the fault of the Sublime Text 2 Composer plugin. If I run Coomposer via Terminal it's fine. Why it doesn't work in ST2 is a bit of a mystery though, as far as I can tell it's executing exactly the same command: /bin/composer.phar update -n -v.

    已采纳该答案
    打赏 评论
  • duanhu7400 2013-06-09 04:17

    If you loaded Mongo into an instance of PHP installed via WAMPSERVER, a likely cause for this issue is that only one of the 2 php.ini files was modified path\to\wamp\bin\php\php5\php.ini. If you add the extension=php_mongo.dll to the path\to\wamp\bin\apache\apche2\bin\php.ini you should be able to execute php with mongo functions from the command line or editer cli tools.

    If you run into composer error:

    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
    

    then it's another indicator you need to update the apache2x\bin\php.ini file

    打赏 评论

相关推荐 更多相似问题