When calling phpdbg you can specify the -S
switch to specify any name to report as the SAPI. For example phpdbg -Scli
to restore it to "cli".
The official online documentation for phpdbg is at https://phpdbg.room11.org/. However, it seems to be very out of date and does not mention the -S
option. To see the current list of options, run phpdbg
and use the help options
command.
$ phpdbg
prompt> help options
Below are the command line options supported by phpdbg
Command Line Options and Flags
Option Example Argument Description
-c -c/my/php.ini Set php.ini file to load
-d -dmemory_limit=4G Set a php.ini directive
-n Disable default php.ini
-q Suppress welcome banner
-v Enable oplog output
-b Disable colour
-i -imy.init Set .phpdbginit file
-I Ignore default .phpdbginit
-O -Omy.oplog Sets oplog output file
-r Run execution context
-rr Run execution context and quit after execution (not respecting
breakpoints)
-e Generate extended information for debugger/profiler
-E Enable step through eval, careful!
-s -s=, -s=foo Read code to execute from stdin with an optional delimiter
-S -Scli Override SAPI name, careful!
-l -l4000 Setup remote console ports
-a -a192.168.0.3 Setup remote console bind address
-x Enable xml output (instead of normal text output)
-p -p, -p=func, -p* Output opcodes and quit
-h Print the help overview
-V Print version number
-- -- arg1 arg2 Use to delimit phpdbg arguments and php $argv; append any $argv argument after it