Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MgsDev's avatar

Trying to Setup MongoDB with Laravel using Homestead

I'm using laravel 5.7 and Php 7.3. I've installed the php mongo db driver using pecl and added the extension mongodb.so to my php.ini file. I've composer installed mongodb/mongdb as well as jenssegers/mongodb. As far as I can see. I've done everything asked in all the documentation I've seen. But I still keep getting this error when I try to run the laravel app:

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'MongoDB\Driver\Manager' not found

Could anyone explain what could be causing this ? Kind regards

0 likes
1 reply
deboertool's avatar

That means you're missing the mongodb extension.

If you add mongdb: true to your features list in Homestead.yaml, it will (among other things) install that extension automatically.

Please or to participate in this conversation.