Skip to content


Subversion checkout URL

You can clone with
Download ZIP
PHP C Other
Latest commit e7ac97d @derickr derickr Merged pull request #143
Failed to load latest commit information.
.travis.scripts Update extension filename in Travis scripts
bin Use UTC time when creating package.xml
docs Update documentation for 1.0.0
scripts PHPC-465: Remove Manager's single write methods
src PHPC-475: toJSON and fromJSON should thrown on error
tests PHPC-475: toJSON and fromJSON should thrown on error
win32 Fix windows bson config
.gitignore Ignore coverage files
.gitmodules We are tracking 1.2.0-dev, not master! Add travis and coveralls support
.travis.yml PHP versions in .travis.yml don't need to be strings HHVM-136: Make hippo and phongo README/CONTRIBUTING files consistent
LICENSE Add Apache 2 license
Makefile.frag Omit merge commits from release changelog Wording tweaks after review
RELEASE-0 PHPC-366: Merge RELEASE-0.* release notes into RELEASE-0
RELEASE-1.0 Add 1.0.0 release notes
Vagrantfile PHPC-279: Add 2.4 (and 2.6) to build matrix and ensure test suite com…
composer.json PHPC-247: Remove 'faker' as prerequisite from running our full test s…
config.m4 Revise system libbson version check error message
config.w32 PHPC-499: Only add the dependency when we're actually enabling the ex…
mkdocs.yml Update GitHub URLs for org change and repo rename
phongo_compat.h Define str_efree() macro for PHP 5.3 compatibility
php_bson.h PHPC-311: Rename from/toArray() functions to from/toPHP()
php_phongo.c PHPC-465: Remove WriteConcernException and WriteErrorException
php_phongo.h Back to -dev
php_phongo_classes.h PHPC-465: Remove WriteConcernException and WriteErrorException

pecl/mongodb (MongoDB driver for PHP)

Build Status Coverage Status

This is the low-level PHP driver for MongoDB. The API is the same as the HHVM driver for MongoDB. The documentation for both of them is the same, and can be found at

The driver is written to be a bare bone layer to talk to MongoDB, and therefore misses many convenience features. Instead, these convenience methods have been split out into a layer written in PHP, the MongoDB Library. Using this library should be your preferred way of interacting with MongoDB.

Please note that the new HHVM and PHP drivers implement a different API from the legacy driver at; therefore existing libraries that use the legacy driver (e.g. Doctrine MongoDB's ODM) will not work with the new drivers.

In the long run, we hope that userland packages will be built atop this driver to implement various APIs (e.g. a BC layer for the existing driver, new fluent interfaces), management utilities (for creating admin utilities and cluster management applications), and other interesting libraries.



To build and install the driver:

$ pecl install mongodb-beta
$ echo "" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

We recommend using this extension in conjunction with our userland library, which is distributed as mongodb/mongodb for Composer.



Related Projects

Something went wrong with that request. Please try again.