# Xdebug Support: PHP debugging

**URL:** https://community.kinsta.com/t/xdebug-support-php-debugging/71
**Category:** Feature Requests
**Created:** [January 18, 2021, 2:58pm UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71 "2021-01-18T14:58:26Z")
**Posts on this page:** 1
**Showing post:** 70

<div class="post-metadata">

### Author: ![Whitesided](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whitesided/32/1673_2.png) [@Whitesided](https://community.kinsta.com/u/Whitesided)
#### Post date: [January 18, 2023, 3:29am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/70 "2023-01-18T03:29:44Z")

</div>

Here’s how I got it working. From the wrench/site configurations option in DevKinsta I made sure “enable xdebug” was checked. In the PHP.ini editor I had the following lines:

xdebug.remote\_autostart=1  
xdebug.remote\_enable=1  
xdebug.profiler\_enable=1  
xdebug.profiler\_enable\_trigger = 1  
xdebug.discover\_client\_host = 1

You can verify this with a phpinfo(); output, but the config on my system was still using the classic port 9000, not the 9003 XDebug 3 supposedly moved to.

I have the PHP Debug`v1.30.0` extension installed in VS Code. With that in place you’ll have the ‘Run and debug’ option on the left. Or press Shift-Command-D to open it. Let it create a launch.json file for you.

I removed everything but the “Listen for Xdebug” configuration; it’s not possible to launch a script for remote execution as far as I know so they were just cluttering up the options.

here’s what one of mine looks like, where my workspace is in the wordpress wp-content directory (I don’t want any visibility into the stock WP code or have searches find Automattic’s classes)

```auto
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "pathMappings": {
                "/www/kinsta/public/devwebsite/wp-content/": "${workspaceRoot}/",
            }
        }
    ]
}

```

My experience has been that setting breakpoints visually can be iffy for triggering; I tend to add an xdebug() call in my code where I want it to halt. Just be careful you don’t leave them in when you push to Kinsta.

---

_[View the full topic](https://community.kinsta.com/t/xdebug-support-php-debugging/71)._
