在PhpStorm上使用浏览器时如何调试代码

编程入门 行业动态 更新时间:2024-10-10 12:16:41
本文介绍了在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.

推荐答案

我设置的工作流程:

  • 使用类似 Xdebug助手的东西.
  • 配置它以使用PhpStorm IDE密钥.
  • Use something like Xdebug helper.
  • Configure it to use PhpStorm IDE Key.
  • 要调试时:

  • 激活Xdebug助手(标记Debug)
  • 转到PhpStorm和Run > Start listening for PHP Debug Connections
  • 在代码中放置一个断点
  • 在Chrome中刷新页面(或转到另一个页面,只需发出请求).
  • Activate Xdebug Helper (Mark Debug)
  • Go to PhpStorm and Run > Start listening for PHP Debug Connections
  • Put a breakpoint at your code
  • 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上使用浏览器时如何调试代码

    本文发布于:2023-06-02 22:46:58,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/457509.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:浏览器   代码   PhpStorm

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!