mnfst / manifest-php
Turn 4xx API errors into 2xx in real time.
Requires
- php: ^8.2
- psr/http-message: ^1.1 || ^2.0
Requires (Dev)
- cakephp/http: ^5.0
- guzzlehttp/guzzle: ^7.5 || ^8.0
- phpunit/phpunit: ^11.0
Suggests
- ext-opentelemetry: Required to hook HTTP clients; without it the SDK instruments nothing (pecl install opentelemetry)
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v0.2.0
- v0.1.0
- dev-feat/php-self-healing-hardening
- dev-chore/release-0.2.0
- dev-fix/restore-query-credentials
- dev-fix/replay-contract
- dev-fix/silent-in-test-suites
- dev-feat/wordpress-requests
- dev-feat/symfony-http-client
- dev-refactor/healer-on-plain-data
- dev-docs/laravel-install-notes
- dev-fix/manifest-idempotent
- dev-fix/read-key-from-env-superglobals
- dev-fix/no-key-sends-nothing
- dev-fix/curl-captures-headers-and-outcome
- dev-fix/persistent-backoff
- dev-fix/form-bodies-verbatim
- dev-fix/json-fidelity
- dev-fix/bounded-body-reads
- dev-fix/keep-response-bodies-readable
- dev-fix/keep-query-credentials-on-retry
- dev-fix/guzzle-failed-retry-throws
- dev-fix/non-utf8-error-bodies
- dev-fix/replay-healed-request
- dev-docs/agent-install-prompt
- dev-docs/readme-parity
- dev-fix/doctor-key-rejected
This package is auto-updated.
Last update: 2026-09-20 15:01:18 UTC
README
Manifest for PHP
Turn π΄ 4xx API errors into π’ 2xx in real time.
What is Manifest
Manifest is a self-healing layer that fixes and retries failed API requests on the fly.
- π― Fix failures automatically before they impact your users.
- π Get notified of root causes so you can fix them permanently.
- π Works across your stack with internal APIs, external services, and agent tools.
How it works
Prerequisites
- PHP 8.2 or higher
- The opentelemetry extension:
pecl install opentelemetry && docker-php-ext-enable opentelemetry
In Docker, one line:
RUN pecl install opentelemetry && docker-php-ext-enable opentelemetry
PHP cannot instrument an HTTP client without it, so the SDK sees nothing until it is installed.
Get started
Start with your agent
"Install Manifest in this app: https://app-staging.manifest.build/prompt-php.md"
The prompt installs the extension, wires the loading order, and stops to let you paste your key.
Start with code
composer require mnfst/manifest-php
Manifest must load before your application makes its first HTTP call. A PHP hook cannot attach
to a function that has already run, so an SDK that loads late sees nothing. Point
auto_prepend_file at the bundled entry point:
; php.ini, a .user.ini, or your php-fpm pool config auto_prepend_file = vendor/mnfst/manifest-php/prepend.php
Or call it yourself, as the first thing your application does:
use function Mnfst\manifest; manifest(); // before any HTTP call
Laravel and CakePHP need no code of their own.
Setup
- Create a project in your Manifest dashboard and copy its project key.
- Set the key as an environment variable:
export MNFST_KEY='your-project-key'
Verify the install from your project directory:
vendor/bin/manifest doctor
It masks and validates the key, reports which coverage level is active, and tells you whether the SDK is loading early enough.
Try it
Send a request that would normally fail. Manifest catches it, repairs it, and retries:
use Illuminate\Support\Facades\Http; $response = Http::post('https://api.example.com/orders', [ 'limit' => 500, // Invalid? Manifest fixes it and retries. ]); echo $response->status(); // See the 200 OK response.
Check your Manifest dashboard to see all repairs and insights.
What is covered
| The app calls an API via⦠| Covered |
|---|---|
Laravel's Http facade |
β healed |
| Guzzle, any client, including one built inside a third-party library | β healed |
CakePHP's Cake\Http\Client |
β healed |
A library with its own raw curl_* client, such as stripe/stripe-php |
β οΈ captured, never healed |
file_get_contents |
β not seen |
The curl_* row is a permanent limit of PHP, not a temporary gap. The extension can observe an
internal function but cannot replace its return value, so those failures appear in your dashboard
while your application still receives the original error.
Supported infrastructure
| Infrastructure | Supported |
|---|---|
| Docker, Kubernetes | β one line in the Dockerfile |
| A VPS or your own server (Forge, Ploi) | β
pecl install opentelemetry |
| Heroku, Platform.sh | β οΈ only if the platform ships the extension |
| Laravel Vapor, Bref | β οΈ possible with a custom Lambda layer |
| Shared hosting (cPanel, Hostinger, OVH) | β you do not control the runtime |
More
Configuration, limits & development Β· API contract Β· Website

