I am new to Yii2. Can anyone tell me how to configure YII2 with mongodb and how to establish connection between YII2 and mongodb? I have tried to download the mongodb package from git hub and tried to run the following command
php composer.phar require --prefer-dist yiisoft/yii2-mongodb "*"
In the command prompt inside the root folder where I have installed Yii2 but I get the following error
Your requirements could not be resolved to an installable set of packages.
Problem 1
- yiisoft/yii2 2.0.0 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
- yiisoft/yii2 2.0.0 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
- Installation request for yiisoft/yii2 == 2.0.0.0 -> satisfiable by yiisoft/yii2[2.0.0].
If you are trying to install it through command prompt then try the following command which using composer
composer require --prefer-dist yiisoft/yii2-mongodb "*"
This works in my windows 8 environment.
To ignore dependency errors while installing the package use --ignore-platform-refs
switch:
composer require --ignore-platform-refs --prefer-dist yiisoft/yii2-mongodb "*"
Remember that you must also have the MongoDB extension installed in PHP for this plugin to work:
http://php.net/manual/en/class.mongodb.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With