Skip to content

DOSCP-61807: PHP Getting Started - #11

Open
tmcneil-mdb wants to merge 1 commit into
mainfrom
DOCSP-61807-PHP-Getting-Started
Open

DOSCP-61807: PHP Getting Started#11
tmcneil-mdb wants to merge 1 commit into
mainfrom
DOCSP-61807-PHP-Getting-Started

Conversation

@tmcneil-mdb

Copy link
Copy Markdown
Collaborator

Summary | JIRA

Adds the PHP Get Started sample application under php/hello-world, mirroring the existing java/hello-world, java-rs/hello-world, kotlin-coroutine/hello-world, and kotlin-sync/hello-world samples. The app connects to a MongoDB deployment using the connection string in the MONGODB_URI environment variable, seeds a few sample product documents into the get_started.products collection, then queries and prints one of them.

Changes

  • php/hello-world/src/HelloWorld.php — sample application
  • php/hello-world/composer.json — dependencies (mongodb/mongodb ^2.0, ext-mongodb ^2.0, PHP >=8.2)
  • php/hello-world/README.md — setup and run instructions
  • php/hello-world/.gitignore — ignores vendor/ and composer.lock
  • Added the PHP entry to the root README
  • Verified on PHP 8.5.2: (End-to-end run against a live deployment)

Notes for Reviewer:

  1. Version note: targeting PHP 8.2, not 7.4

The current PHP library Get Started docs state a minimum of PHP 7.4, but this sample targets PHP 8.2 or later. Two reasons:

  • PHP 7.4 is end-of-life (since Nov 2022) and is no longer available from Homebrew core — installing it now requires a third-party link
  • The docs page is already internally inconsistent on this. Its own install step, pie install mongodb/mongodb-extension, installs ext-mongodb 2.x, and both the 2.x extension and the mongodb/mongodb 2.x library require PHP 8.1+. So "PHP 7.4" doesn't actually work with the steps the page tells you to run.
  1. README assumes a Unix/Linux shell.

@tmcneil-mdb tmcneil-mdb changed the title Porting Node Getting Started to PHP DOSCP-61807: PHP Getting Started Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant