Worker, FrankenPHP, or Traditional FPM: The Transport Is the Same
The PHP runtime argument is real for your application code, but a database client that speaks plain HTTP to a daemon does not participate in it, and here is the code to prove it.
14 posts filed under mongreldb-php.
The PHP runtime argument is real for your application code, but a database client that speaks plain HTTP to a daemon does not participate in it, and here is the code to prove it.
A huge share of the web still runs on hosting plans where you cannot compile anything, and a database client that ships as plain Composer files is the difference between deploying there and telling the customer to move.
The mongreldb-php client validates every permission string against a strict allowlist before it builds a GRANT statement, because DDL fragments cannot be bound as parameters and the classic prepared-statement advice does not cover them.
MongrelDB allows one primary key column per table by design, so a composite natural key like (tenant_id, slug) is modeled as a multi-column unique constraint enforced atomically at commit, with an optional surrogate auto-increment key when you need a point-lookup handle.
MongrelDB stored procedures are versioned, checksummed definitions installed over HTTP, and the pure PHP client exposes the whole lifecycle as five typed calls whose name-keyed argument arrays map directly onto the procedure's declared params.
The MongrelDB PHP client mirrors the daemon's two auth modes with one constructor argument each, and anything more exotic, from per-request token vending to signing proxies, goes behind a one-method TransportInterface you control.
The MongrelDB PHP client substitutes malformed UTF-8 instead of rejecting the whole request, and reserves hard errors for values like INF, NAN, and recursive structures that genuinely have no JSON representation.
The MongrelDB PHP client treats schema as typed data instead of SQL strings, so the same call that creates a table can be paired with a catalog read that proves the server stored what you think it stored.
The MongrelDB PHP client's fluent query builder names the index family in each condition instead of generating SQL for a planner to second-guess, so the index choice you made at schema time is the one that executes.
The MongrelDB PHP client stages multi-row writes locally, commits them as one atomic HTTP batch, and dedupes retries with storage-layer idempotency keys, so a timed-out request is safe to replay without building an outbox.
The MongrelDB PHP client maps HTTP status codes to a small typed exception hierarchy, so a 401 is an AuthException, a 409 is a ConstraintException carrying the server's error code and the failing operation index, and your catch blocks read like the failure modes they handle.
The MongrelDB PHP client hides all of HTTP behind a one-method TransportInterface, ships cURL as the default with a stream fallback, and lets you inject a fake for tests or a PSR-18 bridge for Guzzle without touching application code.
The MongrelDB PHP client opts into PHP 8.5's persistent cURL share handles to carry DNS, TLS sessions, and the connection pool across FPM requests, and silently falls back to per-request pooling on 8.4.
Install the MongrelDB PHP 8.4+ client with Composer and connect to mongreldb-server over HTTP without compiling a custom PHP extension.