beyondcode / herd-community

73 stars 1 forks source link

[Bug]: Xdebug not working with PHPStorm #827

Open josephkerkhof opened 3 weeks ago

josephkerkhof commented 3 weeks ago

Platform

macOS

Operating system version

macOS Sonoma 14.5

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.7.1 PRO

PHP Version

PHP 8.3.8

Bug description

I am not able to get Xdebug to trip for Laravel projects in my PHPStorm IDE.

I have configured PHPStorm to use the following PHP executable: /Users/jkerkhof/Library/Application Support/Herd/bin/php83

Things I've tried:

Here is my CLI interpreter cofiguration:

Screenshot 2024-06-20 at 10 34 49

Steps to reproduce

No response

Relevant log output

No response

sschlein commented 3 weeks ago

Could you please copy the Xdebug configuration from your debug.ini that's in your Herd php config folder to your php.ini of the same folder just to see if it generally works?

If that's the case we need to investigate why the automated breakpoint detection doesn't work.

josephkerkhof commented 3 weeks ago

Hi @sschlein,

I have copied the debug.ini from 83/debug/debug.ini to 83/php.ini as seen in the screenshot.

Screenshot 2024-06-20 at 11 28 56

This had no effect and xdebug still doesn't work.

josephkerkhof commented 3 weeks ago
Screenshot 2024-06-20 at 11 35 12

Interestingly, my PHPStorm is following the php-old.ini file rename.

josephkerkhof commented 3 weeks ago

I have manually set the config file I want in PHPStorm and it still xdebug does not work.

Screenshot 2024-06-20 at 11 38 20
sschlein commented 3 weeks ago

Can you restart all services in Herd? Your application is likely using an old php-form process that doesn't use Xdebug.

Just to confirm: When you call your API, that's via http on a .test domain that Herd resolves?

josephkerkhof commented 3 weeks ago

I have restarted all services and still no catch on the xdebug breakpoint.

Yes, the API in my Bruno application is calling a site labeled v3.test which is a site running on Laravel Herd.

josephkerkhof commented 3 weeks ago

What is interesting is that if I put /Applications/Herd.app/Contents/Resources/xdebug/xdebug-83-arm64.so into my Debugger Extension in PHPStorm, the debugger trips on my tests (and only my tests, not web requests). Screenshot 2024-06-21 at 10 44 34

rabol commented 2 weeks ago

I have the same issue, Herd debugging does not work, and the documentation is less than perfect

josephkerkhof commented 4 days ago

Any update on this? Is this a known issue where Xdebug doesn't work with Herd Pro?