MongoDB driver

Unlike the mongo extension, this extension is developed atop the » libmongoc and » libbson libraries. It provides a minimal API for core driver functionality: commands, queries, writes, connection management, and BSON serialization.

Userland PHP libraries that depend on this extension may provide higher level APIs, such as query builders, individual command helper methods, and GridFS. Application developers should consider using this extension in conjunction with the » MongoDB PHP library, which implements the same higher level APIs found in MongoDB drivers for other languages. This separation of concerns allows the driver to focus on essential features for which an extension implementation is paramount for performance.

User Contributed Notes

mike at eastghost dot com 05-Jun-2017 02:11
There is an adapter - so old MongoClient / MongoDB code will run on the new PHP7/Mongo mess

https://github.com/alcaeus/mongo-php-adapter
n dot vandermeij at mycademy dot com 02-Dec-2016 01:02
*** ONLY FOR VERSIONS >= 1.2.0 ***

If you encounter the following error:

"PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mongodb.so'
 - /usr/lib64/php/modules/mongodb.so: undefined symbol: php_json_serializable_ce in Unknown on line 0"

For a detailed explanation, please visit:

https://derickrethans.nl/undefined-symbol.html

TLDR: You need to load the mongodb.so extension after the json.so
extension

Special thanks to Derick Rethans for pointing this out!