【发布时间】: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/18 和 http://www.yiiframework.com/forum/index.php/topic/57726-solved-yii2-mongodb/ 建议在我的 /etc/php5/cli/php.ini 文件中添加行 extension=mongo.so 。但即使在 php.ini 文件中添加行命令 composer update 仍然给出相同的错误。
请帮忙
【问题讨论】: