# 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:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![sonicviz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/sonicviz/32/391_2.png) [@sonicviz](https://community.kinsta.com/u/sonicviz)
#### Post date: [March 26, 2021, 12:05am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/23 "2021-03-26T00:05:42Z")

</div>

Hi,  
Just started using DevKinsta and discovered this huge blocker to developer UX and productivity.

Has there been any progress with this?

Fwiw I’ve debugged with XDebug using Docker with Devilbox and 10up’s Docker WordPress installs, so it’s definitely possible if you can easily configure the necessary ini files and have the right info for the .vscode launch.json

One key setup variable I’ve found here is the XDebug remote host IP address, which should use the Ethernet IP Address not Virtual Switch (at least it was last time I did it with Devilbox). If you don’t get this right, no connection.  
Ditto for the .vscode file/folder path.

But without official XDebug support, accurate setup information/instructions I’m wary of running down a rabbit hole trying to get this working at the moment - especially when I’m trying to solve client issues. Clients we are bringing to Kinsta btw!

Can you please prioritise this?

Interactive debugging locally is essential, logging is not a substitute when trying to solve gnarly issues -especially when you are on the clients budget time.

It would also be great if you could add support for local [https://www.blackfire.io/](https://www.blackfire.io/) , which lets you profile locally.

Update:  
What’s also a productivity killer is I can’t even clone the site locally to Devilbox or 10UP Docker WordPress for debugging because even the DevKinsta tool won’t let me use All-In-One-migration or Duplicator to make an easy clone.

Thanks,  
Paul

---

<div class="post-metadata">

### Author: ![jamesgreenblue](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/jamesgreenblue/32/1226_2.png) [@jamesgreenblue](https://community.kinsta.com/u/jamesgreenblue)
#### Post date: [March 26, 2021, 1:22am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/24 "2021-03-26T01:22:59Z")

</div>

> [@sonicviz](#):
>
> But without official XDebug support, accurate setup information/instructions I’m wary of running down a rabbit hole trying to get this working at the moment - especially when I’m trying to solve client issues. Clients we are bringing to Kinsta btw!

@michael While full support for interactive debugging enabled via the UI is the ultimate goal, I would very much settle for accurate set up instructions for DevKinsta and Visual Studio Code running on MacOS! Please could this be bumped up in priority because I resonate with @sonicviz’s sentiment regarding the necessity of local debugging – I have been stuck in this rabbit hole for months now!

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [March 26, 2021, 4:24pm UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/25 "2021-03-26T16:24:18Z")

</div>

Hi @sonicviz and @jamesgreenblue. I’m afraid at this time we don’t fully support Xdebug as a plug and play feature but we hope to introduce this in the future. I’m very sorry for the trouble.

> [@sonicviz](#):
>
> Update:  
> What’s also a productivity killer is I can’t even clone the site locally to Devilbox or 10UP Docker WordPress for debugging because even the DevKinsta tool won’t let me use All-In-One-migration or Duplicator to make an easy clone.

I haven’t heard of that occurring before. Would you mind creating a new thread for this so we can discuss further and find out what’s going on?

---

<div class="post-metadata">

### Author: ![okkins](https://avatars.discourse-cdn.com/v4/letter/o/73ab20/32.png) [@okkins](https://community.kinsta.com/u/okkins)
#### Post date: [March 26, 2021, 6:55pm UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/26 "2021-03-26T18:55:50Z")

</div>

Agreed–this is what keeps me from switching for devkinsta for now. Hoping this is added in a future release.

---

<div class="post-metadata">

### Author: ![jamesgreenblue](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/jamesgreenblue/32/1226_2.png) [@jamesgreenblue](https://community.kinsta.com/u/jamesgreenblue)
#### Post date: [March 30, 2021, 7:08am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/27 "2021-03-30T07:08:32Z")

</div>

@michael Understood. Can you predict when the dev team will have time to work on it? I’m going to have to move to an alternative if its going to be more than a month or two from now!

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [March 31, 2021, 6:37pm UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/28 "2021-03-31T18:37:41Z")

</div>

A post was split to a new topic: [Cloning Times Out](https://community.kinsta.com/t/cloning-times-out/551)

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [March 31, 2021, 6:34pm UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/29 "2021-03-31T18:34:14Z")

</div>

@jamesgreenblue I understand and truly sorry that I won’t be able to provide a timeline.

---

<div class="post-metadata">

### Author: ![nemanjac](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/nemanjac/32/400_2.png) [@nemanjac](https://community.kinsta.com/u/nemanjac)
#### Post date: [April 7, 2021, 1:54pm UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/30 "2021-04-07T13:54:11Z")

</div>

@sonicviz and @jamesgreenblue  
I managed to make it work!

My xdebug.ini looks like this:  
[xdebug]  
zend\_extension=xdebug.so  
xdebug.mode=develop,debug  
xdebug.client\_host=host.docker.internal  
xdebug.client\_port=9003

Then, in my PHPStorm, I have used PHP Web Page template to create a new Debug Configuration.  
Point your server to the domain you are working on  
Default port 80 running Xdebug.

I’m using Chrome with [Xdebug helper - Chrome Web Store](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc) extension to activate it for the website I’m working on.

For me, it works like charm.

Took me some time to figure it out, but it works.  
Hope it helps!

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [April 7, 2021, 4:13pm UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/31 "2021-04-07T16:13:24Z")

</div>

Thank you for sharing @nemanjac !!

---

<div class="post-metadata">

### Author: ![sonicviz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/sonicviz/32/391_2.png) [@sonicviz](https://community.kinsta.com/u/sonicviz)
#### Post date: [April 8, 2021, 1:07am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/32 "2021-04-08T01:07:20Z")

</div>

I tried all the above on windows and can’t get it to work.  
Xdebug 3 is also different from xdebug 2, though I used your xdebug 3 config.

Gone back to using [http://devilbox.org/](http://devilbox.org/) because I can use XDebug as well as Elasticsearch locally.

I use VSCode, much prefer it over PHPStorm.

---

<div class="post-metadata">

### Author: ![nemanjac](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/nemanjac/32/400_2.png) [@nemanjac](https://community.kinsta.com/u/nemanjac)
#### Post date: [April 8, 2021, 6:50am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/33 "2021-04-08T06:50:34Z")

</div>

There might be minor differences between 2 and 3 in the matter of config.  
If you are using PHPStorm you can easily test your XDebug config, and you can add an XDebug log on the server too, to figure out what is causing issues.

By all means, if you do have the functional solution that fits your needs, it’s great.  
I just wanted to share as there were questions about how to get it to work.

Cheers

---

<div class="post-metadata">

### Author: ![jamesgreenblue](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/jamesgreenblue/32/1226_2.png) [@jamesgreenblue](https://community.kinsta.com/u/jamesgreenblue)
#### Post date: [April 9, 2021, 1:59am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/34 "2021-04-09T01:59:17Z")

</div>

Hi @nemanjac - we are using Visual Studio Code which appears to be a little bit harder to troubleshoot when it comes to client configuration. Do you have any advice here for the settings to use?

---

<div class="post-metadata">

### Author: ![sonicviz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/sonicviz/32/391_2.png) [@sonicviz](https://community.kinsta.com/u/sonicviz)
#### Post date: [April 9, 2021, 3:21am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/35 "2021-04-09T03:21:14Z")

</div>

I took another stab at it and got DevKinsta Xdebug working. I used my XDebug 3 config from Devilbox.

The following is for an example WordPress install, testing by breakpointing the index.php in the root directory of “YourSiteName”. Running on PHP 7.4, change as appropriate for other versions.

Pull up a windows terminal, then:

Install XDebug into DevKinsta Php if needed:  
docker exec devkinsta\_fpm bash -c “apt-get update;apt-get -y install php7.0-xdebug php7.1-xdebug php7.2-xdebug php7.3-xdebug php7.4-xdebug php8.0-xdebug”  
docker restart devkinsta\_fpm

then

docker exec -it devkinsta\_fpm bash  
cd /etc/php/7.4/fpm/conf.d  
nano 20-xdebug.ini

Edit it to:  
zend\_extension=xdebug.so  
xdebug.mode = debug  
xdebug.start\_with\_request = yes  
xdebug.client\_port = 9003  
xdebug.idekey = VSCODE  
xdebug.client\_host = host.docker.internal  
xdebug.log = /var/log/php/xdebug.log

save, exit back to windows terminal prompt

docker restart devkinsta\_fpm

.vscode launch.json

```
{
  "version": "0.2.0",
  "configurations": 
[
    {
      "name": "Xdebug for Project YourSiteName",
      "type": "php",
      "request": "launch",
      "port": 9003,
      "pathMappings": {
        "/www/kinsta/public/YourSiteName": "${workspaceRoot}"
      }
    },

    {
      "name": "Launch currently open script",
      "type": "php",
      "request": "launch",
      "program": "${file}",
      "cwd": "${fileDirname}",
      "port": 9003
    }
  ]
}
```

---

<div class="post-metadata">

### Author: ![nemanjac](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/nemanjac/32/400_2.png) [@nemanjac](https://community.kinsta.com/u/nemanjac)
#### Post date: [April 9, 2021, 10:00am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/36 "2021-04-09T10:00:28Z")

</div>

@jamesgreenblue  
I did some test last night but @sonicviz beat me to it 😃

I think I was missing `xdebug.idekey = VSCODE` as I don’t VSCode, but PHPStorm.

@sonicviz  
due to some performance issues with docker (might be M1 related only) I commented out the log file.  
It was impacting performance a lot. So after you get it working, you might want to comment it out.

---

<div class="post-metadata">

### Author: ![sonicviz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/sonicviz/32/391_2.png) [@sonicviz](https://community.kinsta.com/u/sonicviz)
#### Post date: [April 9, 2021, 11:35am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/37 "2021-04-09T11:35:37Z")

</div>

No worries, nice to see it’s working for some major IDE’s now.

@nemanjac I see you are also a Codeable dev 🖖

---

<div class="post-metadata">

### Author: ![nemanjac](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/nemanjac/32/400_2.png) [@nemanjac](https://community.kinsta.com/u/nemanjac)
#### Post date: [April 9, 2021, 11:37am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/38 "2021-04-09T11:37:54Z")

</div>

Yeah, it took some work, but we “hacked” it 🙂

I’m thinking of making set of bash scripts that one call pull in and setup what is needed, change configuration etc…

Greetings fellow expert 🖖

---

<div class="post-metadata">

### Author: ![Cheesegrits](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/cheesegrits/32/467_2.png) [@Cheesegrits](https://community.kinsta.com/u/Cheesegrits)
#### Post date: [April 20, 2021, 8:25am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/39 "2021-04-20T08:25:47Z")

</div>

Hi @michael

I just wanted to add my voice to the chorus of “any ETA on this?”, as it cannot be overstated how critical xdebug is for any kind of local development environment for a PHP project. Some would say it’s pretty much the entire point of having a local sandbox.

Even if you can’t get a fully integrated Just Push A Button solution going soon, detailed instructions in the KB for PHPStorm and VSCode would go a long way to easing the pain and time.

To anyone else using PHPStorm, the only thing I had to do beyond the excellent community advise in this thread was to add path mappings in Settings → PHP → Servers for both servers (80 and 443), mapping /www/kinsta/public/SITENAME to C:\Users\MYNAME\DevKinsta\public\SITENAME.

– hugh

---

<div class="post-metadata">

### Author: ![nemanjac](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/nemanjac/32/400_2.png) [@nemanjac](https://community.kinsta.com/u/nemanjac)
#### Post date: [April 20, 2021, 11:29am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/40 "2021-04-20T11:29:31Z")

</div>

Yes, I noticed this yesterday.  
This problem came up with last update. I was on call with another expert @Codeable where we were trying to debug a problem, and noticed that mapping is now necessary for this to work properly.

Thank you for pointing this out, as I had idea to update my post, but forgot.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [April 20, 2021, 4:34pm UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/41 "2021-04-20T16:34:21Z")

</div>

> [@Cheesegrits](#):
>
> any ETA on this?

Not yet I’m afraid but the devs are definitely aware of the strong support for this feature.

---

<div class="post-metadata">

### Author: ![jamesgreenblue](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/jamesgreenblue/32/1226_2.png) [@jamesgreenblue](https://community.kinsta.com/u/jamesgreenblue)
#### Post date: [May 18, 2021, 5:16am UTC](https://community.kinsta.com/t/xdebug-support-php-debugging/71/42 "2021-05-18T05:16:25Z")

</div>

This worked for me too on MacOS

Huge thank you @sonicviz for the consolidated instructions 💚

[Previous page](https://community.kinsta.com/t/xdebug-support-php-debugging/71.md?page=1)

[Next page](https://community.kinsta.com/t/xdebug-support-php-debugging/71.md?page=3)
