-
Notifications
You must be signed in to change notification settings - Fork 484
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
Every php executable produces multiple Xdebug warnings #902
Comments
My current workaround is: "onCreateCommand": "sudo rm /usr/local/etc/php/conf.d/xdebug.ini", |
I am not familiar with the PHP dev stack. Have you explored if the behavior can be controlled through the extension settings for |
I'm not familiar either, I'm running it in a dev container as I'm learning PHP :-) As far as I understand the problem is that when xdebug is enabled (which it is in the image with the I'll have a look at the VSCode extension documentation for some hints, but with only a small hope: the warning is printed exactly because I'm not using the extension when calling PHP. |
The warning are there because no debugger is listening. If you start debugging with vscode, the warnings will go away. {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
} Then you can run the "Listen for XDebug" task and always keep it enabled to disable the warnings, but I'm not satisfied with that solution. I wanted to turn off XDEBUG by default for CLI commands, but keep it enabled for web pages, so I put this hack in my devcontainer's dockerfile : RUN echo 'export XDEBUG_MODE=off' >> /home/vscode/.bashrc This means that every time I'm starting a terminal in vs code, XDebug is disabled by default for that session. I can enable it whenever I want by changing the debug mode for a single command: XDEBUG_MODE=debug bin/phpunit That's the best I came up with for now :) |
When using PHP CLIs inside the dev container they produce multiple warnings like:
The CLIs work as intended, but the warnings make the CLI experience uncomfortable, especially when repeated 20 times after the normal output of a utility.
As I understand the image enables Xdebug functionality so user's own PHP code can be debugged with F5. I know I won't be doing that, what is the best way to disable it in a dev container?
I tried to add
to devcontainer.json but it has no effect.
The text was updated successfully, but these errors were encountered: