MongoDB PHP Extension 1.9.0 released

The PHP team is happy to announce that version 1.9.0 of the mongodb PHP extension is now available on PECL.

Release Highlights

This release makes the extension compatible with PHP 8.

This release ensures that all functions in the extension throw MongoDB\Driver\Exception\InvalidArgumentException instead of emitting a PHP error or warning during argument parsing (e.g. E_WARNING). Previous versions of the driver generally only did this for constructors, which was inconsistent. Note that this behavior does not apply to cases where PHP throws an Error (e.g. TypeError), which is done more consistently in PHP 8 (see: Consistent Type Errors).

The MongoDB\Driver\Cursor class now implements the Iterator interface directly. This change was necessary to ensure consistent behavior across all supported PHP versions.

A complete list of resolved issues in this release may be found at: Release Notes - MongoDB Jira

Documentation

Documentation is available on PHP.net:
PHP: MongoDB - Manual

Feedback

We would appreciate any feedback you might have on the project:
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12484&issuetype=6

Installation

You can either download and install the source manually, or you can install the extension with:

pecl install mongodb-1.9.0

or update with:

pecl upgrade mongodb-1.9.0

Windows binaries are available on PECL:
http://pecl.php.net/package/mongodb

Installed on Ubuntu 20.04 and Fedora 33 and working this morning.
However, as before, the pecl build core dumps at the very end on both platforms.
Nonetheless, the driver works thereafter.

Build process completed successfully
Installing '/usr/lib64/php/modules/mongodb.so'
upgrade ok: channel://pecl.php.net/mongodb-1.9.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini
Segmentation fault (core dumped)

Filed an issue with PHP
They pointed me to a Fedora package release of the 1.9.0 driver.
That package does not actually appear to be released yet to judge from dnf install php-pecl-mongodb which shows 1.8.1.