【问题标题】:yii framework: not able to install MongoDb extension for yii2yii 框架:无法为 yii2 安装 MongoDb 扩展
【发布时间】:2016-01-14 07:14:28
【问题描述】:

我想将 mongodb 与 yii 框架一起使用,因为我正在尝试安装 mongodb 扩展。根据http://www.yiiframework.com/doc-2.0/ext-mongodb-index.html 给出的文档,我已经在我的 composer.json 文件中添加了行 ""yiisoft/yii2-mongodb": "~2.0.0""。

但每当我发出命令composer update 来安装此扩展程序时,都会出现以下错误。

Your requirements could not be resolved to an installable set of packages.

      Problem 1
        - yiisoft/yii2-mongodb 2.0.4 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system.
        - yiisoft/yii2-mongodb 2.0.3 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system.
        - yiisoft/yii2-mongodb 2.0.2 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system.

我在这个问题上搜索了很多,并在这里找到了一个解决方案 https://github.com/yiisoft/yii2-mongodb/issues/18http://www.yiiframework.com/forum/index.php/topic/57726-solved-yii2-mongodb/ 建议在我的 /etc/php5/cli/php.ini 文件中添加行 extension=mongo.so 。但即使在 php.ini 文件中添加行命令 composer update 仍然给出相同的错误。

请帮忙

【问题讨论】:

    标签: php mongodb yii


    【解决方案1】:

    我忘了安装 mongodb php 扩展。安装此扩展程序后,它可以工作。这是安装mongodb扩展的链接http://us1.php.net/manual/en/mongo.installation.php

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-04
      • 1970-01-01
      • 2015-07-21
      • 1970-01-01
      • 2015-01-29
      • 2017-09-05
      • 2012-12-22
      • 1970-01-01
      相关资源
      最近更新 更多