Download the PHP package hughcube/phpinfo without Composer
On this page you can find all versions of the php package hughcube/phpinfo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phpinfo
hughcube/phpinfo
Restore phpinfo() plain text output in CLI, Swoole, Workerman, and RoadRunner into 1:1 pixel-perfect native HTML across PHP versions.
English | 简体中文
💡 Why This Package?
In PHP core (ext/standard/info.c), whether phpinfo() outputs formatted HTML or plain text is dictated by an internal SAPI structure member: sapi_module.phpinfo_as_text:
- Web SAPIs (FPM, Apache mod_php, cli-server):
phpinfo_as_text = 0(outputs full HTML tables with official CSS styling and inline logos). - CLI SAPIs (CLI, Swoole HTTP server, Workerman, RoadRunner):
phpinfo_as_text = 1(outputs plain textkey => valuelists).
When building microservices or APIs with Swoole, Workerman, or Laravel Octane, developers often expose an internal /phpinfo management endpoint. However, calling phpinfo() in these environments outputs unreadable, unstyled raw text.
hughcube/phpinfo solves this by capturing the CLI output stream and parsing it through an in-memory AST state machine, reassembling it into the exact 1:1 pixel-perfect native HTML matching the active runtime PHP version.
🌟 Key Features
- ⚡ Auto Environment Detection: Intelligently senses if the current SAPI natively outputs HTML (e.g. FPM, Apache).
- 🔄 Adaptive Zero-Overhead Output:
- Under FPM / Apache / cli-server: passes through native HTML directly (100% byte fidelity, zero overhead).
- Under Swoole / Workerman / RoadRunner / CLI: captures and reconstructs 1:1 styled HTML.
- 🎨 Version-Accurate Theme Engine:
- Faithfully reproduces official PHP stylesheets from PHP 5.3 up to PHP 8.5+.
- Supports PHP 8.2+ native Dark Mode (
prefers-color-scheme: dark), Sticky Table Headers, and official Base64-encoded PHP & Zend logos.
- 🛡️ 100% Pure Memory AST Parser:
- No subprocesses, no
proc_open/execcalls, completely immune todisable_functionsrestrictions.
- No subprocesses, no
- 🧪 Broad Compatibility: Tested and verified across all PHP versions:
[5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5].
📦 Installation
🚀 Quick Start
1. Adaptive HTML Output (Recommended)
2. Swoole HTTP Server
3. Workerman / Webman
4. Advanced Options
📊 Compatibility Matrix
| PHP Version | Theme Applied | Dark Mode | Sticky Headers | Official Logos |
|---|---|---|---|---|
| < 5.6 | PHP 5.6 Theme | ❌ | ❌ | ✅ |
| 5.6 ~ 7.0 | PHP 5.6 Theme | ❌ | ❌ | ✅ |
| 7.0 ~ 7.4 | PHP 7.0 Theme | ❌ | ❌ | ✅ |
| 7.4 ~ 8.2 | PHP 7.4 Theme | ❌ | ❌ | ✅ |
| 8.2 ~ 8.4 | PHP 8.2 Theme | ✅ | ❌ | ✅ |
| 8.4 ~ 8.5 | PHP 8.4 Theme | ✅ | ✅ | ✅ |
| > 8.5 | PHP 8.5 Theme | ✅ | ✅ | ✅ |
🧪 Testing
📄 License
The MIT License (MIT). Please see LICENSE for more information.