php 如何阻止 xdebug 在 PhpStorm 的第一行停止?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7114762/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 02:02:21  来源:igfitidea点击:

How to stop xdebug from stopping on first line with PhpStorm?

phpdebuggingxdebugphpstorm

提问by pocketfullofcheese

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.

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

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.

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

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=1278da84and 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

如果有帮助,这里是 phpinfo 的 xdebug 部分(分为两部分); https://dzwonsemrish7.cloudfront.net/items/3K3R2N1f1A190K372n0S/Screen%20shot%202011-08-18%20at%203.06.29%20PM.png?v=54c8964d, https://d7.zwons/front 0i133s0U430k3u3w3B1E /屏幕%20shot%202011-08-17%20AT%205.14.25%20 PM.png v = 1278da84?并且在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.

是否有我需要更改的 xdebug 设置?当我进行升级时,我丢失了具有其他 xdebug 配置的 php.ini。

回答by Justin

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.

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

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

为了让它停止,我这样做了(在 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'
  1. 转到首选项 > 语言和框架 > PHP > 调试
  2. 取消选中两个“在第一行强制中断...”选项
  3. 应用并关闭
  4. 在“运行”菜单中,取消选中“在 PHP 脚本的第一行处中断”

回答by klodoma

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

检查首选项的 PHP->Debug 部分中的“Force break at the first line...”。

enter image description here

在此处输入图片说明

BESIDES THAT, also check this setting:

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

enter image description here

在此处输入图片说明

回答by rfay

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.

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

Preferences->PHP->Debug

首选项->PHP->调试

回答by Nikolay Matveev

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

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