Debugging
If you are using VSCode you are ready to use preconfigured debug settings for PHP files. Just navigate to the ant icon left in your VSCode sidebar and click the play button. Read more about here.
Generally, the following things gets done when it comes to debugging:
Start your environment with
yarn docker:startStart the debugger with the play icon
Wait a moment until the debugger is ready. This can take a while for the first time because XDebug will be installed in the WordPress container
Create a breakpoint in a PHP file
Do something so the code gets executed
The browser freezes and VSCode shows you that a breakpoint is reached
Do something
Stop the debugger
XDebug gets deactivated in the WordPress container automatically
Do you get an error while starting the debugger? Please refer to this thread.
Remote development
If you are using the Remote SSH extension already you do not need to take further configurations. Just connect with your server via SSH and start the debugger. If you notice that the debugger "freezes" or "hangs" please make sure the debug port (in our case 9000) can be opened. Check your firewall, read more here.
Last updated
Was this helpful?