Search by

hungnth / debugphp

thienhungdev

Real-time PHP debugging in the browser — zero config, zero dependencies, just send() and see.

Package info

github.com/HungNth/debugphp

pkg:composer/hungnth/debugphp

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-11-16 11:07 UTC

This package is not auto-updated.

Last update: 2026-11-16 17:28:17 UTC


README

DebugPHP

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.

License: MIT PHP Version Packagist Downloads

DebugPHP Demo

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 curl extension.

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

  1. Your PHP app sends each debug entry to the server over HTTP.
  2. The server stores the entry and sends it to the dashboard over SSE.
  3. 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.

Links