Skip to content

Update installation instruction to use pie #1846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ on:

env:
default-release-message: |
The PHP team is happy to announce that version {0} of the [mongodb](https://pecl.php.net/package/mongodb) PHP extension is now available on PECL.
The PHP team is happy to announce that version {0} of the MongoDB PHP extension is now available.
- [mongodb/mongodb-extension](https://packagist.org/packages/mongodb/mongodb-extension#{0}) on Packagist.
- [mongodb](https://pecl.php.net/package/mongodb) on PECL

**Release Highlights**

Expand All @@ -32,16 +34,10 @@ env:
You can either download and install the source manually, or you can install the extension with:

```
pecl install mongodb-{0}
pie install mongodb/mongodb-extension:{0}
```

or update with:

```
pecl upgrade mongodb-{0}
```

Windows binaries are attached to the GitHub release notes.
Sources and Windows binaries are attached to the GitHub release notes.

jobs:
prepare-release:
Expand Down
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,30 @@ languages.
- https://www.php.net/mongodb
- https://www.mongodb.com/docs/drivers/php-drivers/

## Installation
## Installation 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:

```shell
pie install mongodb/mongodb-extension
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add an example on how to use version constraints - we could show how to install version 2.1 or newer:

pie install "mongodb/mongodb-extension:^2.1"

```

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

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

## Installation with pecl

Using pecl to install extensions is deprecated,

To build and install the driver:

$ pecl install mongodb
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
```shell
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.

Expand All @@ -40,7 +58,7 @@ distributed as the
[`mongodb/mongodb`](https://packagist.org/packages/mongodb/mongodb) package for
[Composer](https://getcomposer.org).

## Release Integrity
### Release Integrity
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release integrity is relevant even when not installing with PECL, and moving it to a sub-header doesn't make sense IMO. We can add a general "Installation" header above and make the sections for pie and pecl sub-sections of that installation section.

Since pie doesn't support signature verification and also doesn't support installing from a downloaded binary, we should add a note that integrity validation is not yet supported with pie.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title updated.
Note added.


Releases are created automatically and signed using the
[PHP team's GPG key](https://pgp.mongodb.com/php-driver.asc). This applies to
Expand Down