简体   繁体   中英

Error Install Doctrine-odm MongoDb in Symfony

I have few problems with mongoDb and Symfony. I installed php driver 1.6.12 and I want to install mongoDbBundle

add these lines in my composer.json

{
"require": {
    "doctrine/mongodb-odm": "~1.0",
    "doctrine/mongodb-odm-bundle": "~3.0"
},

}

and Then

php composer.phar update doctrine/mongodb-odm doctrine/mongodb-odm-bundle

But I Have these error

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

  Problem 1
    - doctrine/mongodb-odm 1.0.0 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
    - doctrine/mongodb-odm 1.0.1 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
    - doctrine/mongodb-odm 1.0.2 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
    - doctrine/mongodb-odm 1.0.3 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
    - doctrine/mongodb-odm 1.0.4 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
    - doctrine/mongodb 1.2.1 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.2.0 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
    - Installation request for doctrine/mongodb-odm ~1.0 -> satisfiable by doctrine/mongodb-odm[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4].

As you can see, the doctrine/mongodb-odm dependency requires mongo PHP extension to be installed and enabled in your PHP installation.

You can check if you have it by looking into your php.ini file and/or on a page with phpinfo() . If it's not installed/enabled, you have to do it, otherwise you can't install those dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM