php8.5
Home/ Manual/ reference / phpdbg/ Interactive PHP Debugger

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.

Intro

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. It offers the following features:

  • Step-Through Debugging
  • Flexible Breakpoints (Class Method, Function, File:Line, Address, Opcode)
  • Easy Access to PHP with built-in eval()
  • Userland API
  • SAPI Agnostic - Easily Integrated
  • PHP Configuration File Support
  • JIT Super Globals - Set Your Own !!
  • Optional readline Support - Comfortable Terminal Operation
  • Easy Operation - See Help :)
OptionExample ArgumentDescription
-c-c/my/php.iniSet php.ini file to load
-d-dmemory_limit=4GSet a php.ini directive
-nDisable default php.ini
-qSuppress welcome banner
-vEnable oplog output
-bDisable color
-i-imy.initSet .phpdbginit file
-IIgnore default .phpdbginit
-O-Omy.oplogSet oplog output file
-rRun execution context
-rrRun execution context and quit after execution (not respecting breakpoints)
-eGenerate extended information for debugger/profiler
-EEnable step through eval, careful!
-s-s=, -s=fooRead code to execute from stdin with an optional delimiter
-S-ScliOverride SAPI name, careful!
-l-l4000Setup remote console ports
-a-a192.168.0.3Setup remote console bind address
-xEnable xml output (instead of normal text output)
-p-p, -p=func, -p*Output opcodes and quit
-hPrint the help overview
-VPrint version number
---- arg1 arg2Use to delimit phpdbg arguments and php $argv; append any $argv argument after it

Setup Constants Reference

Source: reference/phpdbg/book.xml · from the official PHP manual (php/doc-en)