1

I'm trying to implement doctrine ODM. I'm taking baby steps but I keep hitting roadblocks. This is one of the many roadblocks so far:

PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "Manager" from namespace "MongoDB\Driver".

When I do this:

use MongoDB\Driver\Manager;    
$manager = new Manager("mongodb://10.0.2.2:27017");
$servers = $manager->getServers();
var_dump($servers);

I'm requiring

"alcaeus/mongo-php-adapter": "^1.0",

which in turns require

"mongodb/mongodb": "^1.0.1"

Is there something I'm missing or that I'm not getting about the whole setup?

2
  • 1
    Does the mongodb extension show up in phpinfo()? And if yes, which version? Commented Dec 13, 2016 at 16:03
  • Did you update Symfony after the changes? Topic: class_map + autoloader Commented Dec 13, 2016 at 16:08

1 Answer 1

2

Mongo was not installed.

To install mongodb

pecl install mongodb

When you have mongodb installed

php -m | grep -i mongo

Should output:

mongodb

Thanks Simon.

Sign up to request clarification or add additional context in comments.

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.