Setting up MongoDb for Symfony2 using composer Setting up MongoDb for Symfony2 using composer symfony symfony

Setting up MongoDb for Symfony2 using composer


I don't know about the PHP version (there might be a problem there, but the error you get doesn't say something about it explicitly), but your problem is the missing configuration in your config.yml.

You must add this even if you don't use the service right now. It does not even have to be valid information, it just must be present.

Add the following to your config.yml (copied from here):

# app/config/config.ymldoctrine_mongodb:    connections:        default:            server: mongodb://localhost:27017            options: {}    default_database: test_database    document_managers:        default:            auto_mapping: true


Symfony works well with DoctrineMongoDBBundle installed via composer. Installing dependencies using composer it's the best practice.

You have to update your php to 5.4.