hungnth / debugphp
Real-time PHP debugging in the browser — zero config, zero dependencies, just send() and see.
dev-main
2026-11-16 11:07 UTC
Requires
- php: ^8.2
- ext-curl: *
Requires (Dev)
- phpstan/phpstan: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-16 17:28:17 UTC
README
Real-time PHP debugging in the browser.
DebugPHP sends PHP debug output to a browser dashboard over Server-Sent Events. The dashboard updates as your app sends data.
Why DebugPHP?
| dd() / var_dump() | Xdebug | Spatie Ray | DebugPHP | |
|---|---|---|---|---|
| Real-time output | ❌ | ❌ | ✅ | ✅ |
| No page disruption | ❌ | ✅ | ✅ | ✅ |
| Zero config | ❌ | ❌ | ❌ | ✅ |
| Browser-based | ❌ | ❌ | ❌ | ✅ |
| Free & open source | ✅ | ✅ | ❌ ($49/yr) | ✅ |
| No dependencies | ✅ | ❌ | ❌ | ✅ |
Installation
composer require hungnth/debugphp --dev
Requirements: PHP 8.2+ and the
curlextension.
Quick Start
use DebugPHP\Debug; // 1. Initialize with your session token from the dashboard Debug::init('your-session-token'); // 2. Send anything Debug::send('Hello DebugPHP!'); Debug::send($user); Debug::send($request->all());
Open the Dashboard to see each entry as it arrives.
Self-Hosted
Run the DebugPHP Server on your own machine with PHP or Docker:
Option A: PHP built-in server
git clone https://github.com/HungNth/debugphp-server.git
cd debugphp-server
composer install
php -S localhost:8787
Set host to your local server:
Debug::init('your-session-token', [ 'host' => 'http://localhost:8787', ]);
Option B: Docker
git clone https://github.com/HungNth/debugphp-server.git
cd debugphp-server
docker compose up
For Docker, set dockerized to true:
Debug::init('your-session-token', [ 'dockerized' => true, ]);
How It Works
- Your PHP app sends each debug entry to the server over HTTP.
- The server stores the entry and sends it to the dashboard over SSE.
- The dashboard displays each entry as it arrives.
┌──────────────┐ POST /api/debug ┌──────────────┐ SSE Stream ┌──────────────┐
│ Your App │ ──────────────────────→ │ DebugPHP │ ────────────────→ │ Dashboard │
│ Debug::send │ │ Server │ │ (Browser) │
└──────────────┘ └──────────────┘ └──────────────┘
Contributing
Please read CONTRIBUTING.md before opening a pull request.
License
MIT. See LICENSE.
