
To install Xdebug the following lines need to be added to the Dockerfile. The next thing is going to be installing and configuring Xdebug inside the docker container, and make it connect the host machine in that port. Waiting for debug server to connect on port 9003 Now the debugging client will be waiting for connections on our host machine, the following message will be prompted: There are thousands of articles for setting up debugging on a complex IDE like PHPStorm, but if you like minimal configurations like me, you can just download and run the minimal DBGp client from the official Xdebug website.Ī simple way of doing this would be: wget Next -ĭevKinsta Installation Does your Site Need a Performance Boost?Įnjoy up to 39% faster load times when you migrate your WordPress site to Kinsta.This brief post will be more like a note for my future self, to know how to setup Xdebug for debugging complex problems on PHP code that is running inside a Docker container. "īreakpoints should now work, and you can begin debugging with your IDE or editor. Replace SITE_NAME with the actual folder name of your site. In this example, we’re using Visual Studio Code (aka VS Code), so we’ll edit the launch.json file and configure the path to our site. In your preferred IDE or code editor, open your site and edit your debugging configuration.

If that doesn’t return your IP address, try the following:

Ifconfig -l | xargs -n1 ipconfig getifaddr In order to make the necessary changes to configure Xdebug with your site in DevKinsta, one of the things you’ll need is your IP address. Starting with DevKinsta 2.8.0, Xdebug is included with the FPM Docker image for DevKinsta. As a PHP extension, it needs to be installed in DevKinsta’s FPM container, which provides PHP.

Xdebug is a popular general debugging extension for PHP.
