Debugging with Xdebug

Setting Up Xdebug with Nitro and VS Code

For this video, we are going to learn how to set up Xdebug with VSCode running a local server on Nitro.

For this video, we are going to learn how to set up Xde­bug with VS Code run­ning a local serv­er on Nitro. Xde­bug runs on the serv­er, as a PHP exten­sion, so the first thing we need to do is enable Xde­bug in our Dock­er con­tain­er that is man­aged by Nitro.

For­tu­nate­ly, Nitro already has sup­port for this and a com­mand we can to tog­gle Xde­bug on and off. This is how we can set whether we are in debug mode or not.

$ nitro xon

This enables Xde­bug so it is run­ning as a PHP exten­sion. Now it will be avail­able to call back to our IDE on port 9000 when it receives a HTTP request.

Debugging with Xdebug is made up of the following videos: