[英]yii framework: not able to install MongoDb extension for yii2
I want to use mongodb with yii framework for that i am trying to install mongodb extension. 我想将mongodb与yii框架一起使用,我正在尝试安装mongodb扩展。 As per the documentation given at http://www.yiiframework.com/doc-2.0/ext-mongodb-index.html i have already added line ""yiisoft/yii2-mongodb": "~2.0.0"" in my composer.json file.
按照http://www.yiiframework.com/doc-2.0/ext-mongodb-index.html上提供的文档,我已经在我的行中添加了““ yiisoft / yii2-mongodb”行:“〜2.0.0”“ composer.json文件。
But whenever i issue command composer update
to install this extension it gives me below error. 但是,每当我发出命令
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.
I search a lot on this issue and found one solution here https://github.com/yiisoft/yii2-mongodb/issues/18 and here http://www.yiiframework.com/forum/index.php/topic/57726-solved-yii2-mongodb/ that suggest to add line extension=mongo.so
in my /etc/php5/cli/php.ini file . 我在这个问题上进行了大量搜索,并在这里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
。 but even after adding line to php.ini file command composer update still gives the same error. 但是即使将行添加到php.ini文件命令后,composer update仍然会给出相同的错误。
Please help 请帮忙
I forgot to install mongodb php extension. 我忘了安装mongodb php扩展名。 after installing this extension it works.
安装此扩展程序后,它可以工作。 here is the link to install mongodb extension http://us1.php.net/manual/en/mongo.installation.php
这是安装mongodb扩展名http://us1.php.net/manual/en/mongo.installation.php的链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.