在PhpStorm上使用浏览器时如何调试代码 [英] How to debug code while using my browser on PhpStorm

查看:325
本文介绍了在PhpStorm上使用浏览器时如何调试代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过PhpStorm和Xdebug调试Laravel.

I cannot debug Laravel via PhpStorm and Xdebug.

当我尝试通过PhpStorm调试单个文件时,它可以正常工作,但是当我设置一个断点并在浏览器中尝试它时,它不起作用.

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等待带有ide键的传入连接,并在那里停止.

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

推荐答案

我设置的工作流程:

  1. 使用类似 Xdebug助手的东西.
  2. 配置它以使用PhpStorm IDE密钥.
  1. Use something like Xdebug helper.
  2. Configure it to use PhpStorm IDE Key.

要调试时:

  1. 激活Xdebug助手(标记Debug)
  2. 转到PhpStorm和Run > Start listening for PHP Debug Connections
  3. 在代码中放置一个断点
  4. 在Chrome中刷新页面(或转到另一个页面,只需发出请求).
  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).

基本上,Xdebug帮助器将成为您的触发器.如果禁用它,PhpStorm将不再调试您的代码.

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

如果您不想中继扩展,则可以转到Xdebug配置并设置:

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

并且开始侦听PHP调试连接"将是您的触发器.

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

这篇关于在PhpStorm上使用浏览器时如何调试代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆