When running phpdbg on the command line, the value returned from php_sapi_name() is "phpdbg" rather than "cli", which upsets some of my code that checks to ensure the code is being ran on the CLI and not in a web service.
I would rather not change my code to suit a debugger. Is there a way to have phpdbg report the SAPI as "cli" rather than "phpdbg"?
When calling phpdbg you can specify the
-Sswitch to specify any name to report as the SAPI. For examplephpdbg -Sclito 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
-Soption. To see the current list of options, runphpdbgand use thehelp optionscommand.