2015-10-15 72 views
0

我想使用yong框架的mongodb,因爲我試圖安裝mongodb擴展。根據http://www.yiiframework.com/doc-2.0/ext-mongodb-index.html給出的文檔,我已經在我的composer.json文件中添加了「」yiisoft/yii2-mongodb「:」〜2.0.0「。yii框架:無法爲yii2安裝MongoDb擴展

但是,每當我發出命令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仍然會給出相同的錯誤。

請幫忙

回答