This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Problem with installing DoctrineMongoDBBundle

Discuss Symfony 2 bundles here

Problem with installing DoctrineMongoDBBundle

by rexkramer » Mon Jan 21, 2013 12:24 am

Hi folks,

I am a newbie with Symfony (and also new to this forum), having a really hard time getting the DoctrineMongoDBBundle to work.

First, I have installed Symfony 2.1.7 (standard) by following the instructions. Every thing went smooth, and I also worked myself through some of the simple examples. All went well. But then I decided to install the DoctrineMongoDBBundle according to these instructions:

"composer.phar update" appeared to run ok, but ending with the following notice (4 times):

Code: Select all
Class Sensio\Bundle\DistributionBundle\Composer\ScriptHandler is not autoloadable, can not call post-update-cmd script

After installation I went to web/app_dev.php/ resulting in:

Code: Select all
Fatal error: Class 'Symfony\Component\ClassLoader\DebugClassLoader' not found in /home/fast2/html-data/app/bootstrap.php.cache on line 542

All of the demo and example bundles that worked without problems before also throw this error.

Google and searching this forum wasn't really helpful, leaving me with the impression that I may be the only one with that problem, and that I missed something crucial during the process.
I have no idea where the problem comes from. My only hint would be that something got broken during the update process as composer has installed several bundles that are still in development status.

Any hints to get this working are greatly appreciated!


Junior Member
Posts: 3
Joined: Sun Jan 20, 2013 11:58 pm

Re: Problem with installing DoctrineMongoDBBundle

by rexkramer » Tue Jan 22, 2013 6:22 pm


OK, after some more digging I may have some more hints regarding this problem for you guys:

The composer notice appears to be strongly related to the fatal error I have ecountered. From looking at the composer.json file, after composer.phar update composer is supposed to run the following command:

Code: Select all
 "scripts": {
        "post-install-cmd": [

This appears to fail. Consequently, the bootstrap.php.cache file mentioned in the fatal error wasn't updated.
But still I have no idea why this happended...


Junior Member
Posts: 3
Joined: Sun Jan 20, 2013 11:58 pm

Re: Problem with installing DoctrineMongoDBBundle

by rexkramer » Wed Jan 23, 2013 3:13 am


More news from my debugging sessions. Here is some output from the composer.phar update command after adding the DoctrineMongoDBBundle to composer.json:

Code: Select all
 composer.phar update
Loading composer repositories with package information
Updating dependencies
  - Installing psr/log (1.0.0)
    Loading from cache

  - Removing twig/extensions (dev-master)
  - Removing symfony/swiftmailer-bundle (dev-master)
  - Removing symfony/monolog-bundle (dev-master)
  - Removing monolog/monolog (1.2.1)
  - Removing symfony/assetic-bundle (dev-master)
  - Removing swiftmailer/swiftmailer (dev-master)
  - Removing sensio/generator-bundle (dev-master)
  - Removing sensio/framework-extra-bundle (dev-master)
  - Removing sensio/distribution-bundle (dev-master)
  - Removing kriswallsmith/assetic (dev-master)
  - Removing jms/security-extra-bundle (dev-master)
  - Removing jms/parser-lib (dev-master)
  - Removing phpoption/phpoption (dev-master)
  - Removing jms/di-extra-bundle (dev-master)
  - Removing jms/metadata (dev-master)
  - Removing jms/aop-bundle (dev-master)
  - Removing jms/cg (dev-master)
  - Removing doctrine/orm (2.3.x-dev)
  - Removing doctrine/doctrine-bundle (dev-master)
  - Removing doctrine/dbal (2.3.x-dev)
  - Removing jdorn/sql-formatter (dev-master)
  - Updating twig/twig dev-master (3111e12 => 93c6a8d)
    Checking out 93c6a8dedc46c73ccdd61342de3d5e761e4412f6

  - Updating symfony/symfony dev-master (v2.2.0- => 8a351f0)
    Checking out 8a351f07cb51d69177324b2c316f17982f211d53

As you can see composer removes all kinds of (important) bundles. As I found out the sensio/distribution-bundle appears to be responsible for updating the bootstrap.php.cache, so the post install/update-cmd in composer.json was supposed to fail.

So I just tried to update only the doctrine/mongodb-odm-bundle instead of updating everything in the json-file. The update was successfull, and the examples for the bundle appear to work flawlessly as far as I can say by now.

All in all this had been a very painful experience. I am still not sure whether the installation documentation for DoctrineMongoDBBundle is simply wrong of if something else behind the scenes is not working properly...the main problem is now that I cannot simply run composer.phar update without ruining my entire Symfony installation.


Junior Member
Posts: 3
Joined: Sun Jan 20, 2013 11:58 pm

Re: Problem with installing DoctrineMongoDBBundle

by dalu » Thu Jan 24, 2013 3:23 pm

what does your composer.json look like?

if you're using 2.1.x why
Updating symfony/symfony dev-master (v2.2.0- => 8a351f0)

might be the reason why it isn't working
I'm for hire. 60€/h + vat. 50% up front.
Posts: 53
Joined: Fri Nov 02, 2012 9:47 pm

Re: Problem with installing DoctrineMongoDBBundle

by lipaonline » Tue Apr 02, 2013 10:00 am

Hi i just installed this Bundle..

everything is mostly fine :)

I hade the same problem as : ... p-on-os-x/

now i have Mongo 1.0.11...

but, i got this error :

FatalErrorException: Error: Call to undefined method
MongoCollection::setSlaveOkay() in
line 630

because this function (setSlaveOkay()) is for (PECL mongo >=1.1.0)

then i commented this line on bundle...

Is-it a problem ? it's just for development... on serveur i have 1.3.0RC3-dev ( installed auto with "normal" process.. why not a stable version ??)

Junior Member
Posts: 1
Joined: Tue Apr 02, 2013 9:53 am

Re: Problem with installing DoctrineMongoDBBundle

by lesleyg » Mon Jul 08, 2013 5:40 pm

I get the same issue with Mongo 1.0.11, anyone know?
This laser cap review tells you about the laser cap, read laser cap reviews for more.
Junior Member
Posts: 1
Joined: Mon Jul 08, 2013 5:37 pm