plehopper.blogg.se

Visual studio code wsl2
Visual studio code wsl2







If you are NOT running VSCode on the same host, which will be the case if you are running VSCode in WSL2 mode on Windows, then currently you seem to need to specify the IP address of the WSL2 VM for the client_host. If you want a quick image to test this in I can recommend webdevops/php-dev. If you are running docker on the same host as VSCode, then you should be able to trigger debug connections with the following (If you’re system supports ): XDEBUG_CONFIG= "client_port=9000 client_host= remote_enable=1" php test.php Code language: JavaScript ( javascript ) The hostname needs to be set to either localhost or 0.0.0.0 Code language: JSON / JSON with Comments ( json ) This can be added for all cases as it will not stop local listens from working. VSCode will require you to add a hostname field to the debug configuration. In some setups the above localhost solution may already work for you! XDEBUG_CONFIG= "client_port=9000 client_host=localhost remote_enable=1" php test.php Code language: JavaScript ( javascript ) Docker / Containersĭebugging from docker containers can require a little more effort and will also differ between setups (Especially if using WLS2). (Remember, you’ll need a breakpoint in a file to see it stop). Then on the same host as VSCode you could then run the following to trigger a connection to the debug client.

visual studio code wsl2

Make sure VSCode is listening for connections, and that you have a script with a breakpoint in it ready to run.









Visual studio code wsl2