[Bug]: XDebug not working on HerdPro with PHP Storm #435
-
Operating system versionMac OS Sonoma 14.3.1 (M3) System architectureARM64 (M1, M2, etc) Herd Version1.4.1 PHP Version8.2.16 Bug descriptionI am trying to debug from phpstorm
Steps to reproduceInstall PHP storm, install herd on MAC Ventura Relevant log outputNo response |
Beta Was this translation helpful? Give feedback.
Replies: 34 comments 7 replies
-
The CLI version will only activate Xdebug when you run "herd debug". |
Beta Was this translation helpful? Give feedback.
-
ah so i need the browser extension for debugging a site? I thought the pro version did it automatically? |
Beta Was this translation helpful? Give feedback.
-
The pro version automatically enables Xdebug on-the-fly, either by setting a breakpoint in your PHPStorm project, or if you don't use PHPStorm, by toggling the Xdebug extension. Be sure to save the file after setting a breakpoint, so that Herd can detect it. |
Beta Was this translation helpful? Give feedback.
-
Maybe I am missing something and apologies if its dumb questions! |
Beta Was this translation helpful? Give feedback.
-
Yeah, that's how it should work. You should be able to verify this by returning One thing you might want to look out for: We detect your breakpoint by looking for a folder in your parked paths, that matches the hostname. |
Beta Was this translation helpful? Give feedback.
-
Something is not good so if i do phpinfo xdebug isnt in it? |
Beta Was this translation helpful? Give feedback.
-
The paths are not changed from the site name btw |
Beta Was this translation helpful? Give feedback.
-
Just to double check, if you use the Xdebug browser extension, it works as expected? |
Beta Was this translation helpful? Give feedback.
-
no doesnt work there either? |
Beta Was this translation helpful? Give feedback.
-
Weird. Could you please toggle the checkbox in the Debugger settings? Maybe that setting was not properly persisted |
Beta Was this translation helpful? Give feedback.
-
ah getting somewhere! |
Beta Was this translation helpful? Give feedback.
-
Any clues to this error? (with and without the chrome extension) |
Beta Was this translation helpful? Give feedback.
-
this fixed it for me 👍 |
Beta Was this translation helpful? Give feedback.
-
I tried this several times |
Beta Was this translation helpful? Give feedback.
-
@mpociot I am using filamentphp and livewire could that have anything do with it? |
Beta Was this translation helpful? Give feedback.
-
I'm also experiencing this - I am able to step through it to my actual breakpoint, but I get the feeling there's an option in PHPStorm that is a little wonky. Every request served by PHP gets halted at line 20 in /Applications/Herd.app/Contents/Resources/valet/dump-loader.php. My project is Vue with Inertia, so I think that might rule out filament/livewire @craigvc |
Beta Was this translation helpful? Give feedback.
-
I'm using Livewire but unfortunately xdebug is not working for me either. It keeps breaking at the dump-loader script. Break at first line in script is disabled. |
Beta Was this translation helpful? Give feedback.
-
@mpociot can we get a little guidance here ? |
Beta Was this translation helpful? Give feedback.
-
@paulmichaeldev I did read that can actually be normal in the sense its sending lots of ajax requests - so would apply from inertia and livewire perspective. Issue i am stuck at is i cant even step through or it doesnt detect my breakpoints - phpstorm EAP and 2023.3.4 |
Beta Was this translation helpful? Give feedback.
-
@craigvc if it stops for you in the dump-loader.php file, this is the default behavior of PHPStorm as it breaks on the first line. |
Beta Was this translation helpful? Give feedback.
-
I am also running into the issue with it stopping in the dump-loader.php file. If I don't have it set to break at first line in PHP scripts, it never pops up the debugger. If I have that setting checked, it starts in the dump-loader.php file and I have to click so many times that I often click past my break point. The cli debugging is flawless. 'herd debug artisan' works as described and is great. I'm sure it's a skill issue on my part but at the moment, xdebug through the browser is unusable. I've also never had xdebug working but now that I see more and more people talk about the benefits, I feel like I'm missing out on a great tool. I'm more than willing to help, I'm just unsure where and how to help. |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to include a switch to force xdebug to be on or off as a fallback? |
Beta Was this translation helpful? Give feedback.
-
I dont believe you should have closed this as it is still a bug. |
Beta Was this translation helpful? Give feedback.
-
I noticed that even with "Break at first line in PHP scripts" turned off, it would still break in the dump-loader. Then I noticed "Force break at first line when a script is outside the project" and after turning that off, because the dump-loader is in the vendor directory which is not considered to be in the project, it now only stops on my breakpoints. I have noticed that auto-saving is not good enough for Herd to detect the breakpoints. Cmd+S after changing a breakpoint is still necessary. Hopefully this helps a few people here. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Same issue here. Installing Herd still breaks debugging in PHPStorm. |
Beta Was this translation helpful? Give feedback.
-
I was having this issue, too. My solution:
This will then cause PhpStorm to load that extension, regardless of whether auto-detect is working, whenever you run a test in debug mode. Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Hello, this is still breaking for me! When I first set it all up, I did hit a breakpoint in some random code when using the browser, outside of my project. But now, not even that happens any longer and i can't hit any breakpoints outside of the scratch files that PhpStorm runs itself. If it's any help, when i do finish a debug session in a scratch file, PhpStorm warns I have the following contents in my PHP ini:
I get no errors in my PHP logs or in the browser console. If anyone could help that would be awesome! I have tried a few of the solutions listed on this discussion but none of them seemed to fix the issue. |
Beta Was this translation helpful? Give feedback.
-
Toggling "Detect breakpoints automatically" in herd debugger settings fixed this for me |
Beta Was this translation helpful? Give feedback.
I noticed that even with "Break at first line in PHP scripts" turned off, it would still break in the dump-loader. Then I noticed "Force break at first line when a script is outside the project" and after turning that off, because the dump-loader is in the vendor directory which is not considered to be in the project, it now only stops on my breakpoints.
I have noticed that auto-saving is not good enough for Herd to detect the breakpoints. Cmd+S after changing a breakpoint is still necessary.
Hopefully this helps a few people here.