xdebug can't connect from web page in PHPStorm 2024.1.2

I am dealing with what seems to be a ubiquitous problem getting xdebug to work wtih 2024.1.2. I have everything installed and configured: php, composer (via homebrew) xdebug 3 (via pecl), laravel valet running, xdebug helper in the browser. I can see that xdebug is propery enabled both by running php -i on the command line and phpinfo() in the browser. PHPStorm also shows xdebug installed in CLI settings. If I put a breakpoint in a console command, xdebug works fine. However, if I put a breakpoint in something initiated from the browser (e.g. a Laravel controller), it does not work. I have done this many times before on other computers with no problem, including another Macbook M2 just like this one. What else could I be missing?

0

Hi there,

1. What Xdebug log says about this? Does Xdebug even tries to connect? And the IP:port are using correct values?

2. What do you have for “Settings/Preferences | PHP | Debug | Ignore external connections through unregistered server configurations

If you have that option enabled, will disabling it bring any dialog window?

3. What ports do you use for Xdebug? is it the default 9003 or some another?

4. What port numbers for Xdebug do you have in PhpStorm? if it's more than one – will placing the right one first make any difference?

0

1. `xdebug.log` shows
[3808] Log opened at 2024-05-31 00:55:11.498414
[3808] [Step Debug] WARN: Debugger is not working optimally, as Xdebug is loaded before Zend OPcache
[3808] Log closed at 2024-05-31 00:55:11.758367

2. Checked. Unchecking it brought up the dialog to accept the connection once, but that was it. Restarting PHPStorm didn't bring it up like it usually does after restart, and still no breakpoints working.

3. 9003

4. it was 9000,9003. Removing 9000 did not make a difference

0

In idea.log, I get a lot of 
2024-05-31 21:39:43,037 [2627686]   FINE - #c.j.p.d.c.PhpLineBreakpointHandler - Can't register breakpoint. No path mapping for local path 'file:///Users/steve/Sites/laravel/members/vendor/spatie/laravel-query-builder/src/Sorts/SortsCallback.php'

0

OK, it must have been a combo of the changes I made above and setting a path mapping (again) for Project Files at PHP | Servers.

Breakpoints are working now.

Thanks.

0

Glad to hear you have it resolved now 👍

0

I am afraid that I'm also experiencing this issue.

I have followed through the steps which have been performed above, but unfortunately I am still experiencing this issue.

This has only happened since I upgraded to PHPStorm 2024.1.

Please advise.

0

For further information - I have downgraded to 2023.3 via Jetbrains Toolbox, and this works without issue and no settings changed. 

0

I had a lot of issues with debugging with the 2024 version. And as some of you have been talking about is that the mappings were off. 

I had never had this problem before the 2024 version, but now i had to uncheck “use path mappings”. For some reason it works great before i start to secure my site with a self signed SSL certificate. I use Laravel Valet to serve the php application.

Richard Pickering 

Thanks for giving us a resolution to point us in the right direction Steve E 

0

请先登录再写评论。