如何使用 PhpStorm 阻止 xdebug 在第一行停止?

发布于 2024-11-30 02:55:04 字数 1149 浏览 2 评论 0 原文

我遇到了这个奇怪的问题。我的所有设置都可以正常工作,直到我更新了 PHP 版本。我使用 macports 并安装了 php5 和 php5-xdebug 端口。

xdebug 正在工作,但它在我的脚本的第一行停止,即使我在 PhpStorm 中禁用了该选项。那里没有断点,代码其他部分的断点工作正常。

如果有帮助,这里是 phpinfo 的 xdebug 部分(分为两部分); https://dzwonsemrish7.cloudfront.net/items/3K3R2N1f1A190K372n0S/Screen%20shot%202011-08-18%20at%203.06.29%20PM.png?v=54c8964dhttps://dzwonsemrish7.cloudfront.net/items/0i133s0U430k3u3w3B1E/Screen%20shot%202011-08-17%20at%205.14.25%20PM.png?v=1278da84 和证明它在 phpStorm 中被禁用:https://dzwonsemrish7.cloudfront.net/items/3W2S060I1b0W1q0z0c45/Screen%20shot%202011-08-18%20at%203.07.00%20PM.png?v=85471026

rel=" noreferrer 我需要更改 xdebug 设置吗?当我进行升级时,我丢失了包含其他 xdebug 配置的 php.ini。

I'm having this weird problem. All my settings used to work OK, until I updated my version of PHP. I use macports and have the php5 and php5-xdebug ports installed.

xdebug is working, but it is stopping on the first line of my script even though I have the option disabled in PhpStorm. There is no breakpoint there, and breakpoints in other parts of the code are working OK.

If it helps, here is the xdebug portion of phpinfo (in two parts);
https://dzwonsemrish7.cloudfront.net/items/3K3R2N1f1A190K372n0S/Screen%20shot%202011-08-18%20at%203.06.29%20PM.png?v=54c8964d, https://dzwonsemrish7.cloudfront.net/items/0i133s0U430k3u3w3B1E/Screen%20shot%202011-08-17%20at%205.14.25%20PM.png?v=1278da84 and the proof it is disabled in phpStorm: https://dzwonsemrish7.cloudfront.net/items/3W2S060I1b0W1q0z0c45/Screen%20shot%202011-08-18%20at%203.07.00%20PM.png?v=85471026

Is there an xdebug setting I need to change? When I did the upgrade, I lost my php.ini that had some other xdebug configuration.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

盛夏尉蓝 2024-12-07 02:55:04

上面的内容对我不起作用,因为据我所知,如果您使用 Xdebug,您获得的唯一调试书签是启动/停止和调试此页面。我没有看到任何特定于在第一行停止的书签,并且启动/停止书签或停止 PHPStorm 在 PHPStorm 中侦听都没有为我解决问题。

为了让它停止,我这样做了(在 OS X 上):

  1. 转到 Preferences >语言与框架> PHP>调试
  2. 取消选中“在第一行强制中断...”选项
  3. 应用并关闭
  4. 在“运行”菜单中,取消选中“在 PHP 脚本中在第一行中断”

例如,即使您有路径映射,public/index.php 路径也可能不会被视为项目的一部分。

The above didn't work for me because as far as I can tell if you're using Xdebug the only debug bookmarklets you get is start/stop and debug this page. I don't see any bookmarklet specific to stopping on first line, and neither the start/stop bookmarklets nor stopping PHPStorm from listening within PHPStorm fixed the problem for me.

To get it to stop I did this (on OS X):

  1. Go to Preferences > Languages & Frameworks > PHP > Debug
  2. Uncheck both of the 'force break at the first line...' options
  3. Apply and close
  4. In the Run menu, uncheck 'Break at the first line in PHP scripts'

For example, even if you have Path-Mappings, the public/index.php path may not be considered as part of the project.

Saygoodbye 2024-12-07 02:55:04

检查首选项的“PHP->调试”部分中的“在第一行强制中断...”。

输入图像描述此处

除此之外,还要检查此设置:

在此处输入图像描述

Check the "Force break at the first line..." in the PHP->Debug section of preferences.

enter image description here

BESIDES THAT, also check this setting:

enter image description here

倾城花音 2024-12-07 02:55:04

我对 PHPStorm 的问题是我正在做 Drupal 并且 index.php 位于项目之外(因为该项目是一个模块)。我需要在首选项的“PHP->调试”部分中取消选中“在第一行强制中断...”设置。

首选项->PHP->调试

My problem with PHPStorm was that I was doing Drupal and the index.php was outside the project (since the project is a module). I needed to uncheck the settings "Force break at the first line..." in the PHP->Debug section of preferences.

Preferences->PHP->Debug

情感失落者 2024-12-07 02:55:04

您是否使用调试书签? “在第一行中断”选项也可以通过“xdebug Break On”和“xdebug Break Off”书签来控制。

Do you use debug bookmarklets? 'Break at the first line' option could be also controlled via 'xdebug Break On' and 'xdebug Break Off' bookmarklets.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文