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

我有个奇怪的问题。我所有的设置都能正常工作,直到我更新了我的 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=54c8964d phpStorm 中禁用 https://dzwonsemrish7.cloudfront.net/items/0i133s0U430k3u3w3B1E/Screen%20shot%202011-08-17%20at%205.14.25%20PM.png?v=1278da84的证明译者:

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

45213 次浏览

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

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.

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

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