-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Auto Attach Filter setting #957
Comments
I found a way around this. I created these three PHP VSCode debug launch configurations. The PHP: Console one will allow you to run the currently opened PHP script in the VSCode debug console. The PHP: Terminal one will allow you to run any PHP script on your device using the terminal, when you start debugging it will wait for you to run the script and then start debugging, allowing you to use arguments within the script.
And this is what I added to my php.ini on the system
I am using xdebug v3 The only minor downside to using the PHP: Terminal is that the outputs will only be in the terminal and not in the debug console. You can still use the debug console to change variable values for example, but any echo calls will appear in the terminal and not in the debug console. |
Hi @trymeouteh sorry for not getting back to you earlier. I did not have much time to look at how JS-debug's "Auto Attach Filter" works, but from the documentation it seems like it sets some environment variables in the terminal that it opens. PHP/Xdebug work in similar but not completely same way. It's good to understand that VSCODE IDE listens for incoming debug connections and PHP/Xdebug initiates the debug connection. It does so when it is correctly configured. The XDEBUG_MODE has to contain the "debug" switch and there must either be a So if Xdebug is loaded, but not configured, you probably could get it to connect to the IDE if you set environment variables There are options how this could be implemented, but I do not really see a benefit over using Regarding the output. Yes, the stdout and strerr will be printed in the terminal, where the PHP script is executing. If you start the script via the There is also an option to redirect STDOUT of the script via a DBGP command, but this is not exposed in any way in the current php-debug extension. STDOUT redirection is not possible though... |
The JavaScript Debug extension has a setting named "Auto Attach Filter". It allows you to choose from one of the three settings
Having this setting in PHP Debug can allow a user to run a PHP script in the terminal, with custom arguements and have the debugger.
The text was updated successfully, but these errors were encountered: