I'm very new to Symfony2, I have followed the guide on the Symfony2 website to install the MongoDb Doctrine bundles using composer (which is also how I installed Symfony2)
http://symfony.com/doc/master/bundles/DoctrineMongoDBBundle/index.html
I added the lines into app/autoload.php:
use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;
AnnotationDriver::registerAnnotationClasses();
and app/AppKernal.php
new Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle(),
that were suggested in the guide, but when I try to load the Symfony app (which is just the Demo app) I get the following error:
InvalidArgumentException: The service definition "doctrine_mongodb.odm.document_manager" does not exist.
[And a lot more trace, let me know if this would be useful]
If I comment out the line I added into app/AppKernal.php then the Symfony Demo app loads with no problems.
I have run app/check.php and I noticed the following warning:
WARNING When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156
Install PHP 5.3.8 or newer if your project uses annotations.
I am currently using the PHP version shipped with Ubuntu (5.3.5-1ubuntu7.11) and it looks like the composer/mongodb bits above use Annotations.
I can't find anything obvious when I do a Google search and assumed this would be more common if it's really a problem with my PHP version.
From what I can tell I will need to either:
- Compile PHP from source to upgrade to 5.3.8
- Install Symfony2 not using composer, as it looks like the old way of installing the MongoDB bundles doesn't use annotations
- I've totally missed something because I have no idea how Symfony2 works :D
Does anyone have any suggestions or other solutions that would be easier? I'd really like to stick with composer if I can.