How to debug code while using my browser on PhpStorm

若如初见. 提交于 2019-12-13 10:53:40

问题


I cannot debug Laravel via PhpStorm and Xdebug.

When I try to debug a single file via PhpStorm, it works fine, but when I set a breakpoint and try it on the browser, it doesn't work.

PhpStorm waits for incoming connection with ide key and it stops there.


回答1:


The workflow that I've set:

  1. Use something like Xdebug helper.
  2. Configure it to use PhpStorm IDE Key.

When you want to debug:

  1. Activate Xdebug Helper (Mark Debug)
  2. Go to PhpStorm and Run > Start listening for PHP Debug Connections
  3. Put a breakpoint at your code
  4. Refresh your page in Chrome (or go to another one, just make a request).

Basically, the Xdebug Helper will be your trigger. If you disable it, PhpStorm no longer will debug your code.


If you don't want to relay on an extension, you can go to your Xdebug config and set:

xdebug.idekey=PHPSTORM
xdebug.remote_autostart=1

And "Start listening for PHP Debug Connections" will be your trigger.



来源:https://stackoverflow.com/questions/29527954/how-to-debug-code-while-using-my-browser-on-phpstorm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!