10

After installing symfony2 and mongodb by composer.json (The installations have been completed successfuly). But, when I execute the application, I get the following error message:

InvalidArgumentException: Unable to replace alias "doctrine_mongodb.odm.document_manager" with "doctrine.odm.mongodb.document_manager".

This is my composer.json:

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.2.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "1.2.*",
    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.1.*",
    "symfony/swiftmailer-bundle": "2.2.*",
    "symfony/monolog-bundle": "2.2.*",
    "sensio/distribution-bundle": "2.2.*",
    "sensio/framework-extra-bundle": "2.2.*",
    "sensio/generator-bundle": "2.2.*",
    "jms/security-extra-bundle": "1.4.*",
    "jms/di-extra-bundle": "1.3.*",
    "doctrine/mongodb-odm-bundle": "3.0.*"
},

Does anyone have an idea?

3

2 Answers 2

23

You have to add doctrine_mongodb configuration to app/config/config.yml

doctrine_mongodb:
    connections:
        default:
            server: mongodb://localhost:27017
            options: {}
    default_database: kickass
    document_managers:
        default:
            auto_mapping: true
Sign up to request clarification or add additional context in comments.

Comments

0

Your composer.json should also contain this one following line to get the actual ODM library installed. This will solve your problem

"doctrine/mongodb-odm": "1.0.*@dev",

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.