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

43,091

Solution 1

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.

Solution 2

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

Solution 3

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

Solution 4

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

Share:
43,091

Related videos on Youtube

pocketfullofcheese
Author by

pocketfullofcheese

Updated on March 29, 2022

Comments

  • pocketfullofcheese
    pocketfullofcheese about 2 years

    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.

  • TWright
    TWright about 10 years
    Oh, and I might add that you can only toggle this option while running a current PHPStorm debug session.
  • sh4
    sh4 over 9 years
    I ran out of space because in my root partition (/) because of a huge number of projects inside /var/www. Since I don't have a separate partition for /var I had to move them all to /home/ and then I symlinked /home/user/www to /var/www/. It looks that PHPStorm now detects my projects as "external" like your index.php and doesn't know how to handle the symlinks. I unchecked the options and now isn't stopping in every file, thank you!
  • Kirkland
    Kirkland over 8 years
    Just wanted to add to this (so hopefully Google catches it) that this function in PHPStorm was also causing any php script I would run on my local machine to hang, so commands like homestead up or php <?php echo 'hi'; ?> were not running, it would just stop (as xdebug was breaking on the first line). Unchecking these two options helped fix that.
  • andyface
    andyface over 8 years
    The option under the 'Run' menu was doing it for me, kinda annoying to have two places which seem automatically set to break all the time on the first line.
  • David Mann
    David Mann about 8 years
    That screen shot though, perfect. Works for fixing Zero Config Mode as well, which doesn't seem to have a debug launcher config.
  • David Mann
    David Mann about 8 years
    That screen shot though, perfect. Works for fixing Zero Config Mode as well, which doesn't seem to have a debug launcher config.
  • William Turrell
    William Turrell about 8 years
    Please vote to improve this in the PhpStorm issue tracker - youtrack.jetbrains.com/issue/WI-30649
  • William Turrell
    William Turrell about 8 years
    Please vote to simplify/clarify the menus in the PhpStorm issue tracker - youtrack.jetbrains.com/issue/WI-30649
  • Lyoneel
    Lyoneel about 8 years
    This is the RIGHT answer, idk why are two separate options for same action, that element in run menu was causing my problem. thanks
  • Jasmine Hegman
    Jasmine Hegman almost 8 years
    Thank you so much, we could not figure it out either. Who would have thought the Run -> "Break at first line in PHP scripts" is not available from the Preferences/Settings pane. Almost everything else is.
  • Dankó Dávid
    Dankó Dávid almost 7 years
    Eclipse also has the same options in the Perefences > PHP > Debug.