What's the current state of PHPStorm and Xdebug 2.9.0?

Can I get some help to flesh out my understanding of Local+Xdebug and PhpStorm?

Since PHPStorm isn’t my primary editor, I thought I was doing something wrong (and maybe I still am!) but I wanted to post my findings so that the Local community could help me get things figured out.

So basically, I couldn’t get the latest version of PHPStorm (2020.3.1) to work with the version of Xdebug in Local (currently version 2.9.0). It was only when I downloaded an older version of PHPStorm that I was able to trigger the breakpoints that were being set.

The specific version that worked for me was 2020.2.4


After doing some research, I found this bug report that’s closed, but it seems like the issue is still present:

@jasontheadams – I see that you commented on the above WI-56500 issue – Are you using the latest version of PHPStorm along with Xdebug + Local or are you doing something else?


As a follow-up, I can advocate for upgrading Xdebug to the 3.x line, though I don’t know how quickly we’ll be able to get that updated. Mostly I wanted to gauge what PHPStorm users are doing and if I’m missing an easy configuration step.

Hi @ben.turner!

Yeah, that bug in PhpStorm has to do when the Xdebug connection is closed. Th issue has been resolved and is in the upcoming dot-release version. In the meantime, the workaround is to stop and start the site within Local every time one goes to use Xdebug. It’s not fun, but it does work.

Otherwise, I don’t have to do anything extra or special to get Xdebug working with PhpStorm, so long as I have it configured properly to use the correct PHP executable.

1 Like

Nice! Thanks for the sanity check @jasontheadams!

I re-installed the latest version of PHPStorm and still had the issue, so I kept investigating.

The issue was likely hyper-specific to me (I think I messed something up on my system while testing PHP 8) but I’ll post what I did in case it helps someone else.

Basically, Xdebug is usually configured to listen on port 9000. Local’s PHP service uses this setting which you can find in the site’s configuration file:

site-name/conf/php/php.ini.hbs
[xdebug]
{{#if os.windows}}
zend_extension = php_xdebug.dll
{{else}}
zend_extension = {{extensionsDir}}/xdebug.so
{{/if}}

xdebug.remote_enable=1
xdebug.remote_connect_back=Off
xdebug.remote_port="9000"
xdebug.profiler_enable=0

What’s on Port 9000?

I went looking at what was listening on that port with:

sudo lsof -i:9000; sudo lsof -tnP -i:9000 | xargs -n 1 ps -p

There were some php-fpm processes that just wouldn’t be killed, and inspecting what those processes were indicated that they were for PHP 8.0

How to kill php-fpm that won’t be killed?

Any time I tried to kill those processes, they would respawn. So googling lead me to this SO solution:

In the dir ~/Library/LaunchAgents find this file homebrew.mxcl.php.plist .
Delete it and restart my mac, the problem was resolved.

I removed that file and restarted the computer, and now everything is working with Local+Xdebug+PHPStorm!

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.