PHPackages                             mongodb/mongodb-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. mongodb/mongodb-extension

ActivePhp-ext[Database &amp; ORM](/categories/database)

mongodb/mongodb-extension
=========================

MongoDB driver extension

2.3.3(1mo ago)91941.7k↑132.2%216[9 issues](https://github.com/mongodb/mongo-php-driver/issues)[3 PRs](https://github.com/mongodb/mongo-php-driver/pulls)Apache-2.0PHPPHP &gt;=8.1,&lt;9CI passing

Since Nov 26Pushed 4d ago67 watchersCompare

[ Source](https://github.com/mongodb/mongo-php-driver)[ Packagist](https://packagist.org/packages/mongodb/mongodb-extension)[ Docs](https://jira.mongodb.org/browse/PHPC)[ RSS](/packages/mongodb-mongodb-extension/feed)WikiDiscussions v2.x Synced 2d ago

READMEChangelog (10)DependenciesVersions (86)Used By (0)Security (1)

MongoDB PHP Driver
==================

[](#mongodb-php-driver)

[![Tests](https://github.com/mongodb/mongo-php-driver/actions/workflows/tests.yml/badge.svg)](https://github.com/mongodb/mongo-php-driver/actions/workflows/tests.yml)[![Coverage Status](https://camo.githubusercontent.com/280252418b9ad5c741ffcc968bb5e7094b680dd2e7d1b66a274c31fe3d754230/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d6f6e676f64622f6d6f6e676f2d7068702d6472697665722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/mongodb/mongo-php-driver?branch=master)[![Coding Standards](https://github.com/mongodb/mongo-php-driver/actions/workflows/clang-format.yml/badge.svg)](https://github.com/mongodb/mongo-php-driver/actions/workflows/clang-format.yml)

This extension is developed atop the [libmongoc](https://github.com/mongodb/mongo-c-driver) and [libbson](https://github.com/mongodb/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](https://github.com/mongodb/mongo-php-library), which implements the same higher level APIs found in MongoDB drivers for other languages.

Documentation
-------------

[](#documentation)

-
-

Installation
------------

[](#installation)

### With pie

[](#with-pie)

To install this extension, you need [pie](https://github.com/php/pie) installed on your system. `pie` is a modern tool for managing PHP extensions.

Install the [`mongodb/mongodb-extension`](https://packagist.org/packages/mongodb/mongodb-extension) package from Packagist using the following command:

```
pie install mongodb/mongodb-extension
```

This will automatically download, build, and enable the MongoDB extension for your PHP installation.

Add a version constraint after the extension name to restrict can be installed:

```
pie install mongodb/mongodb-extension:^2.1.0
```

The constraint `^2.1.0` will install the latest version `>= 2.1.0 < 3.0.0-dev`.

For more details on using `pie`, see the [pie documentation](https://github.com/php/pie).

### with pecl

[](#with-pecl)

Note

Using pecl to install extensions is deprecated.

To build and install the extension:

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

The MongoDB PHP Driver follows [semantic versioning](https://semver.org/) for its releases.

Additional installation instructions may be found in the [PHP.net documentation](https://php.net/manual/en/mongodb.installation.php).

This extension is intended to be used alongside the [MongoDB PHP Library](https://github.com/mongodb/mongo-php-library), which is distributed as the [`mongodb/mongodb`](https://packagist.org/packages/mongodb/mongodb) package for [Composer](https://getcomposer.org).

Release Integrity
-----------------

[](#release-integrity)

Note

Integrity validation is not yet supported when installing with `pie`. If you require signature verification, use the manual or PECL installation methods described below.

Releases are created automatically and signed using the [PHP team's GPG key](https://pgp.mongodb.com/php-driver.asc). This applies to the git tag as well as all release packages provided as part of a [GitHub release](https://github.com/mongodb/mongo-php-library/releases). To verify the provided packages, download the key and import it using `gpg`:

```
gpg --import php-driver.asc
```

### PECL package

[](#pecl-package)

PECL packages are made available as release artifacts on GitHub, as well as on the [PECL homepage](https://pecl.php.net/mongodb). The GitHub release will also contain a detached signature file for the PECL package (named `mongodb-X.Y.Z.tgz.sig`).

To verify the integrity of the downloaded package, run the following command:

```
gpg --verify mongodb-X.Y.Z.tgz.sig mongodb-X.Y.Z.tgz
```

Note

No verification is done when using `pecl` to install the package. To ensure release integrity when using `pecl`, download the tarball manually from the GitHub release, verify the signature, then install the package from the downloaded tarball using `pecl install mongodb-X.Y.Z.tgz`.

### Windows

[](#windows)

Windows binaries are distributed through GitHub releases in the form of a ZIP package. The GitHub release will also contain a detached signature file for the PECL package. To verify the integrity of the package, run the following command:

```
gpg --verify php_mongodb-X.Y.Z.zip.sig php_mongodb-X.Y.Z.zip
```

Note

Windows binaries distributed directly through PECL are not signed by MongoDB and cannot be verified. If you need to verify the integrity of the downloaded binary, always download them from the GitHub release.

Reporting Issues
----------------

[](#reporting-issues)

Issues pertaining to the extension should be reported in the [PHPC](https://jira.mongodb.org/secure/CreateIssue!default.jspa?project-field=PHPC)project in MongoDB's JIRA. Library-related issues should be reported in the [PHPLIB](https://jira.mongodb.org/secure/CreateIssue!default.jspa?project-field=PHPLIB)project.

For general questions and support requests, please use one of MongoDB's [Technical Support](https://docs.mongodb.com/manual/support/) channels.

### Security Vulnerabilities

[](#security-vulnerabilities)

If you've identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions in [Create a Vulnerability Report](https://docs.mongodb.org/manual/tutorial/create-a-vulnerability-report).

Development
-----------

[](#development)

Development is tracked in the [PHPC](https://jira.mongodb.org/projects/PHPC/summary) project in MongoDB's JIRA. Documentation for contributing to this project may be found in [CONTRIBUTING.md](CONTRIBUTING.md).

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance96

Actively maintained with recent releases

Popularity56

Moderate usage in the ecosystem

Community37

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~52 days

Recently: every ~15 days

Total

82

Last Release

4d ago

Major Versions

v1.x-dev → v2.0.x-dev2025-05-23

1.21.1 → 2.1.12025-06-13

1.21.2 → 2.1.32025-10-07

1.21.4 → 2.1.72026-01-28

v1.21.x-dev → 2.1.82026-02-04

PHP version history (2 changes)1.20.0PHP &gt;=7.4,&lt;9

2.1.2PHP &gt;=8.1,&lt;9

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/400034?v=4)[Jérôme Tamarelle](/maintainers/GromNaN)[@GromNaN](https://github.com/GromNaN)

![](https://avatars.githubusercontent.com/u/383198?v=4)[Andreas Braun](/maintainers/alcaeus)[@alcaeus](https://github.com/alcaeus)

![](https://avatars.githubusercontent.com/u/555869?v=4)[Alexander Vos](/maintainers/vos)[@vos](https://github.com/vos)

---

Top Contributors

[![jmikola](https://avatars.githubusercontent.com/u/244663?v=4)](https://github.com/jmikola "jmikola (2220 commits)")[![bjori](https://avatars.githubusercontent.com/u/72407?v=4)](https://github.com/bjori "bjori (879 commits)")[![alcaeus](https://avatars.githubusercontent.com/u/383198?v=4)](https://github.com/alcaeus "alcaeus (656 commits)")[![derickr](https://avatars.githubusercontent.com/u/208074?v=4)](https://github.com/derickr "derickr (466 commits)")[![mongodb-php-bot](https://avatars.githubusercontent.com/u/162451593?v=4)](https://github.com/mongodb-php-bot "mongodb-php-bot (124 commits)")[![mongodb-dbx-release-bot[bot]](https://avatars.githubusercontent.com/u/124201131?v=4)](https://github.com/mongodb-dbx-release-bot[bot] "mongodb-dbx-release-bot[bot] (79 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (40 commits)")[![kvwalker](https://avatars.githubusercontent.com/u/7121013?v=4)](https://github.com/kvwalker "kvwalker (39 commits)")[![GromNaN](https://avatars.githubusercontent.com/u/400034?v=4)](https://github.com/GromNaN "GromNaN (38 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (16 commits)")[![paulinevos](https://avatars.githubusercontent.com/u/5345273?v=4)](https://github.com/paulinevos "paulinevos (10 commits)")[![pboyd04](https://avatars.githubusercontent.com/u/594097?v=4)](https://github.com/pboyd04 "pboyd04 (8 commits)")[![mongodb-drivers-pr-bot[bot]](https://avatars.githubusercontent.com/u/124201131?v=4)](https://github.com/mongodb-drivers-pr-bot[bot] "mongodb-drivers-pr-bot[bot] (8 commits)")[![tanlisu](https://avatars.githubusercontent.com/u/46271307?v=4)](https://github.com/tanlisu "tanlisu (7 commits)")[![levon80999](https://avatars.githubusercontent.com/u/70570610?v=4)](https://github.com/levon80999 "levon80999 (6 commits)")[![petk](https://avatars.githubusercontent.com/u/1614009?v=4)](https://github.com/petk "petk (4 commits)")[![DaveRandom](https://avatars.githubusercontent.com/u/2396425?v=4)](https://github.com/DaveRandom "DaveRandom (3 commits)")[![kaplanlior](https://avatars.githubusercontent.com/u/2017058?v=4)](https://github.com/kaplanlior "kaplanlior (3 commits)")[![puppyofkosh](https://avatars.githubusercontent.com/u/5248080?v=4)](https://github.com/puppyofkosh "puppyofkosh (2 commits)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (2 commits)")

---

Tags

mongodbmongodb-driverphppersistencedatabasemongodbdriver

### Embed Badge

![Health badge](/badges/mongodb-mongodb-extension/health.svg)

```
[![Health](https://phpackages.com/badges/mongodb-mongodb-extension/health.svg)](https://phpackages.com/packages/mongodb-mongodb-extension)
```

###  Alternatives

[mongodb/mongodb

MongoDB driver library

1.6k67.9M625](/packages/mongodb-mongodb)[doctrine/doctrine-bundle

Symfony DoctrineBundle

4.8k254.4M4.1k](/packages/doctrine-doctrine-bundle)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[doctrine/mongodb-odm-bundle

Symfony Doctrine MongoDB Bundle

38919.7M236](/packages/doctrine-mongodb-odm-bundle)[moriony/silex-mongo-provider

Mongo service provider for the Silex framwork.

128.5k](/packages/moriony-silex-mongo-provider)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
