xref: /PHP-7.4/sapi/phpdbg/README.md (revision 1c94aac8)
1# The interactive PHP debugger
2
3Implemented as a SAPI module, phpdbg can exert complete control over the
4environment without impacting the functionality or performance of your code.
5
6phpdbg aims to be a lightweight, powerful, easy to use debugging platform for
7PHP 5.4+.
8
9## Features
10
11* Stepthrough Debugging
12* Flexible Breakpoints (Class Method, Function, File:Line, Address, Opcode)
13* Easy Access to PHP with built-in eval()
14* Easy Access to Currently Executing Code
15* Userland API
16* SAPI Agnostic - Easily Integrated
17* PHP Configuration File Support
18* JIT Super Globals - Set Your Own!!
19* Optional readline Support - Comfortable Terminal Operation
20* Remote Debugging Support - Bundled Java GUI
21* Easy Operation - See Help
22
23## Planned
24
25* Improve Everything :)
26
27## Installation
28
29To install **phpdbg**, you must compile the source against your PHP installation
30sources, and enable the SAPI with the configure command. It is enabled by
31default:
32
33```bash
34cd /path/to/php-src
35./buildconf --force
36./configure
37make -j8
38./sapi/phpdbg/phpdbg --version
39```
40
41Where the source directory has been used previously to build PHP, there exists a
42file named `config.nice` which can be used to invoke configure with the same
43parameters as were used by the last execution of `configure`.
44
45**Note:** PHP must be configured with the switch `--with-readline` for phpdbg to
46support history, autocompletion, tab-listing etc.
47
48## Command line options
49
50The following switches are implemented (just like cli SAPI):
51
52* `-n` ignore php ini
53* `-c` search for php ini in path
54* `-z` load zend extension
55* `-d` define php ini entry
56
57The following switches change the default behaviour of phpdbg:
58
59* `-v` disables quietness
60* `-s` enabled stepping
61* `-e` sets execution context
62* `-b` boring - disables use of colour on the console
63* `-I` ignore .phpdbginit (default init file)
64* `-i` override .phpgdbinit location (implies -I)
65* `-O` set oplog output file
66* `-q` do not print banner on startup
67* `-r` jump straight to run
68* `-E` enable step through eval()
69* `-l` listen ports for remote mode
70* `-a` listen address for remote mode
71* `-S` override SAPI name
72
73**Note:** Passing `-rr` will cause phpdbg to quit after execution, rather than
74returning to the console.
75
76## Getting started
77
78See the [website](https://phpdbg.room11.org) for tutorials/documentation.
79