PHP Debug Bar

PHP 调试栏。「Debug bar for PHP」

Github stars Tracking Chart

PHP Debug Bar

Latest Stable Version Total Downloads License Build Status

Displays a debug bar in the browser with information from php.
No more var_dump() in your code!

Screenshot

Features:

  • Generic debug bar
  • Easy to integrate with any project
  • Clean, fast and easy to use interface
  • Handles AJAX request
  • Includes generic data collectors and collectors for well known libraries
  • The client side bar is 100% coded in javascript
  • Easily create your own collectors and their associated view in the bar
  • Save and re-open previous requests
  • Very well documented

Includes collectors for:

Checkout the demo for
examples and phpdebugbar.com for a live example.

Integrations with other frameworks:

(drop me a message or submit a PR to add your DebugBar related project here)

Installation

The best way to install DebugBar is using Composer
with the following command:

composer require maximebf/debugbar

Quick start

DebugBar is very easy to use and you can add it to any of your projects in no time.
The easiest way is using the render() functions

<?php

// Require the Composer autoloader, if not already loaded
require 'vendor/autoload.php';

use DebugBar\StandardDebugBar;

$debugbar = new StandardDebugBar();
$debugbarRenderer = $debugbar->getJavascriptRenderer();

$debugbar["messages"]->addMessage("hello world!");
?>
<html>
    <head>
        <?php echo $debugbarRenderer->renderHead() ?>
    </head>
    <body>
        ...
        <?php echo $debugbarRenderer->render() ?>
    </body>
</html>

The DebugBar uses DataCollectors to collect data from your PHP code. Some of them are
automated but others are manual. Use the DebugBar like an array where keys are the
collector names. In our previous example, we add a message to the MessagesCollector:

$debugbar["messages"]->addMessage("hello world!");

StandardDebugBar activates the following collectors:

  • MemoryCollector (memory)
  • MessagesCollector (messages)
  • PhpInfoCollector (php)
  • RequestDataCollector (request)
  • TimeDataCollector (time)
  • ExceptionsCollector (exceptions)

Learn more about DebugBar in the docs.

Main metrics

Overview
Name With Ownerphp-debugbar/php-debugbar
Primary LanguagePHP
Program languagePHP (Language Count: 4)
Platform
License:MIT License
所有者活动
Created At2013-06-07 17:59:04
Pushed At2025-05-13 14:37:43
Last Commit At2025-05-13 09:37:23
Release Count98
Last Release Namev2.2.2 (Posted on )
First Release Name1.0 (Posted on )
用户参与
Stargazers Count4.3k
Watchers Count76
Fork Count412
Commits Count825
Has Issues Enabled
Issues Count259
Issue Open Count117
Pull Requests Count434
Pull Requests Open Count11
Pull Requests Close Count74
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private