The Interactive PHP Debugger

Last update: Apr 26, 2022

The interactive PHP debugger

Implemented as a SAPI module, phpdbg can exert complete control over the environment without impacting the functionality or performance of your code.

phpdbg aims to be a lightweight, powerful, easy to use debugging platform for PHP 5.4+

phpdbg on travis-ci

Historical Repository

phpdbg was developed here, then merged into php-src: This repository is no longer used.

Please open issues on bugsnet, and send pull requests directly to php-src.

Features

  • Stepthrough Debugging
  • Flexible Breakpoints (Class Method, Function, File:Line, Address, Opcode)
  • Easy Access to PHP with built-in eval()
  • Easy Access to Currently Executing Code
  • Userland API
  • SAPI Agnostic - Easily Integrated
  • PHP Configuration File Support
  • JIT Super Globals - Set Your Own!!
  • Optional readline Support - Comfortable Terminal Operation
  • Remote Debugging Support - Bundled Java GUI
  • Easy Operation - See Help :)

Planned

  • Improve Everything :)

Installation

To install phpdbg, you must compile the source against your PHP installation sources, and enable the SAPI with the configure command.

cd /usr/src/php-src/sapi
git clone https://github.com/krakjoe/phpdbg
cd ../
./buildconf --force
./configure --enable-phpdbg
make -j8
make install-phpdbg

Where the source directory has been used previously to build PHP, there exists a file named config.nice which can be used to invoke configure with the same parameters as were used by the last execution of configure.

Note: PHP must be configured with the switch --with-readline for phpdbg to support history, autocompletion, tab-listing etc.

Command Line Options

The following switches are implemented (just like cli SAPI):

  • -n ignore php ini
  • -c search for php ini in path
  • -z load zend extension
  • -d define php ini entry

The following switches change the default behaviour of phpdbg:

  • -v disables quietness
  • -s enabled stepping
  • -e sets execution context
  • -b boring - disables use of colour on the console
  • -I ignore .phpdbginit (default init file)
  • -i override .phpgdbinit location (implies -I)
  • -O set oplog output file
  • -q do not print banner on startup
  • -r jump straight to run
  • -E enable step through eval()
  • -l listen ports for remote mode
  • -a listen address for remote mode
  • -S override SAPI name

Note: Passing -rr will cause phpdbg to quit after execution, rather than returning to the console.

Getting Started

See the website for tutorials/documentation

http://php.net/phpdbg

GitHub

https://github.com/krakjoe/phpdbg
You might also like...

Kint - a powerful and modern PHP debugging tool.

Kint - a powerful and modern PHP debugging tool.

Kint - debugging helper for PHP developers What am I looking at? At first glance Kint is just a pretty replacement for var_dump(), print_r() and debug

Jun 29, 2022

😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.

😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.

Tracy - PHP debugger Introduction Tracy library is a useful helper for everyday PHP programmers. It helps you to: quickly detect and correct errors lo

Jun 26, 2022

PHP Benchmarking framework

PHP Benchmarking framework

PHPBench is a benchmark runner for PHP analogous to PHPUnit but for performance rather than correctness. Features include: Revolutions: Repeat your co

Jul 2, 2022

PHP Debug Console

PHP Debug Console

PHP Console A web console to try your PHP code into Creating a test file or using php's interactive mode can be a bit cumbersome to try random php sni

Jun 15, 2022

PCOV - CodeCoverage compatible driver for PHP

PCOV A self contained CodeCoverage compatible driver for PHP Requirements and Installation See INSTALL.md API /** * Shall start recording coverage in

Jun 27, 2022

Low-overhead sampling profiler for PHP 7+

Low-overhead sampling profiler for PHP 7+

phpspy phpspy is a low-overhead sampling profiler for PHP. For now, it works with Linux 3.2+ x86_64 non-ZTS PHP 7.0+ with CLI, Apache, and FPM SAPIs.

Jun 27, 2022

The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function that you can use instead of var_dump().

VarDumper Component The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function t

Jun 29, 2022

PHP errors for cool kids

PHP errors for cool kids

whoops PHP errors for cool kids whoops is an error handler framework for PHP. Out-of-the-box, it provides a pretty error interface that helps you debu

Jul 1, 2022

Clockwork - php dev tools in your browser - server-side component

Clockwork - php dev tools in your browser - server-side component

Clockwork is a development tool for PHP available right in your browser. Clockwork gives you an insight into your application runtime - including requ

Jun 29, 2022
Comments
  • 1. New help updates

    As per IRC discussions, here is the pull request for these changes. Note that scope of these is krakjoe/phpdbg#59 and krakjoe/phpdbg#69. Sorry about that, but I had to include the first to implement the second.

    Also note that this branch is a few commits behind krakjoe/phpdbg/master so you'll need to merge these changes. There's also a could of TODOs outstanding as discussed in krakjoe/phpdbg#69.

    Reviewed by TerryE at 2014-02-16 11:48
  • 2. Fix phpdbg.1 man page installation when build != src directory

    Some PHP compilation methods (e.g. Redhat PHP rpms) make SAPI's build a clean directory. The addition of the phpdbg.1 man page breaks this method, as it's assuming the build directory is the source directory.

    This affects a build I'm creating for PHP 5.6.0RC2 https://github.com/webtatic-rpms/php56w/blob/master/php56.spec#L1344

    This PR fixes the problem by forcing the Makefile to get the man page from the source directory.

    an example I think recreates the problem:

    cd /usr/src/php-src/sapi
    git clone https://github.com/krakjoe/phpdbg
    cd ../
    ./buildconf --force
    mkdir ./build-phpdbg
    
    pushd ./build-phpdbg
    ln -s ../configure
    ./configure --enable-phpdbg
    popd
    
    make -C build-phpdbg -j8
    make -C build-phpdbg install-phpdbg
    
    Reviewed by andytson at 2014-07-05 12:19
  • 3. Remove phpdbg_help_header() output, too verbose

    Hello :-),

    Each time we type help …, the [Welcome to phpdbg, the interactive PHP debugger, v%s] message is printed. I think this is too verbose. This message is printed when we start the REPL, no need to print it each time we ask some help.

    After a short discussion on IRC, it seems the header is printed just to get the version number. Thus, I propose this patch to simplify it a bit:

    • the phpdbg_help_header macro unfolds to NULL, in this way, we didn't break the existing code and allow the reuse of this macro,
    • the phpdbg_help_footer macro now includes the version number.

    Also, I am planning to (i) add the help version command, (ii) expose the phpdbg version through a PHP constant (maybe PHPDBG_VERSION_ID, to be consistent with PHP_VERSION_ID, (iii) add a phpdbg option to get the version directly (-v is already taken to enable oplog output, maybe -V could be a good candidate).

    Thoughts?

    Reviewed by Hywan at 2013-12-18 12:09
Dontbug is a reverse debugger for PHP
Dontbug is a reverse debugger for PHP

Dontbug Debugger Dontbug is a reverse debugger (aka time travel debugger) for PHP. It allows you to record the execution of PHP scripts (in command li

May 8, 2022
Php Debugger to run in terminal to debug your code easily.
Php Debugger to run in terminal to debug your code easily.

What is Dephpugger? Dephpugger (read depugger) is an open source lib to make a debug in php direct in terminal, without necessary configure an IDE. Th

May 20, 2022
Php Debugger to run in terminal to debug your code easily.
Php Debugger to run in terminal to debug your code easily.

What is Dephpugger? Dephpugger (read depugger) is an open source library that allows a developer to debug in php direct in terminal, without necessary

May 20, 2022
A Laravel Package to integrate Nette Tracy Debugger
A Laravel Package to integrate Nette Tracy Debugger

Nette Tracy for Laravel 5 Better Laravel Exception Handler Features Visualization of errors and exceptions Debugger Bar (ajax support @v1.5.6) Excepti

Jun 16, 2022
Yet Another Swoole Debugger
Yet Another Swoole Debugger

English | δΈ­ζ–‡ yasd Yet Another Swoole Debugger. document How to use it build You'll need to install the Boost library first. macOS: brew install boost

Jun 20, 2022
Slim Framework Tracy Debugger Bar
 Slim Framework Tracy Debugger Bar

Slim Framework Tracy Debugger Bar configure it by mouse now in package: Panel Description Slim Framework - Slim Environment RAW data Slim Container RA

Feb 26, 2022
Handle PHP errors, dump variables, execute PHP code remotely in Google Chrome

PHP Console server library PHP Console allows you to handle PHP errors & exceptions, dump variables, execute PHP code remotely and many other things u

Jun 24, 2022
PHP APM (Alternative PHP Monitor)

APM (Alternative PHP Monitor) APM (Alternative PHP Monitor) is a monitoring extension enabling native Application Performance Management (APM) for PHP

Jun 15, 2022
Zipkin PHP is the official PHP Tracer implementation for Zipkin

Zipkin PHP is the official PHP Tracer implementation for Zipkin, supported by the OpenZipkin community. Installation composer require openz

Jun 30, 2022
Debug bar for PHP
Debug bar for PHP

PHP Debug Bar Displays a debug bar in the browser with information from php. No more var_dump() in your code! Features: Generic debug bar Easy to inte

Jun 26, 2022