$ show mlocati/docker-php-extension-installer
This repository provides a comprehensive shell script (`install-php-extensions`) that automates the installation of PHP extensions in official Docker PHP images (both Alpine and Debian variants). The script handles dependency resolution, version pinning, source-based compilation, and cleanup of build artifacts. It supports over 160 extensions, including those bundled with PHP source, PECL packages, and proprietary agents (New Relic, Blackfire, Datadog). The repo also includes a structured compatibility database (`data/supported-extensions`, `data/dependencies.json`) that tracks extension-to-PHP-version mappings, library version pins, and detection mechanisms. CI workflows automatically test extension installation across a large matrix of PHP versions and distros, and a daily update checker monitors new releases and runs tests, notifying maintainers via Telegram if issues arise. The project is a developer utility, not a service or library, and is distributed as a Docker image and standalone script.
The LLM identified 2 files worth highlighting for reuse:
A structured JSON database defining all supported PHP extensions, their system library dependencies (with pinned versions), source URLs, version detection methods (PECL, GitHub tags, web pages), and per-extension installation flags. Accompanied by a JSON schema (data/dependencies.schema.json) for validation. This data file is self-contained and can be reused by any tool that needs to manage PHP extension versions or dependencies across multiple distros.
A standalone PHP script that validates all JSON files in the repository against their associated JSON schemas, using the `opis/json-schema` library. It can be extracted and used in any project that maintains JSON data files and schemas, providing automated consistency checks in CI pipelines.