For this video we are going to learn how to set up Xdebug with PhpStorm running a local server on Craft Nitro.
For this video we are going to learn how to set up Xdebug with PhpStorm running a local server on Craft Nitro. Xdebug runs on the server, as a PHP extension, so the first we need to do is enable Xdebug in our Docker container that is managed by Craft Nitro.
Fortunately, Craft Nitro already has support for Xdebug and a simple command we run run to toggle Xdebug on and off.
$ nitro xon
Nitro commands like xon
are context-aware, so if you’re not in a project directory that Nitro recognizes, then it will ask you to choose for which site you want to enable Xdebug. If you are in a project directory, then it will enable it for that project.
This enables Xdebug so it is running as a PHP extension. Now it will be available 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: