Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPStorm Xdebug always breaks on first line

I've setup Xdebug with the following configuration:

[xdebug]
zend_extension="/usr/local/Cellar/php55-xdebug/2.2.5/xdebug.so"
xdebug.remote_enable= "On"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.remote_autostart = "Off"
xdebug.profiler_enable = "On"
xdebug.profiler_output_dir = "/tmp"
xdebug.idekey="PHPSTORM"

and using "remote debugging" with the Xdebug toggler plugin for safari.

But in PHPStorm it always breaks on the first line even though I have no breakpoint set there. I have looked in the settings of and found a setting related to this. But I have unchecked those. But even after a restart it still breaks on the first line of the first file.

PHPStorm settings

How can I disable this behaviour?

like image 729
Matthijn Avatar asked Sep 17 '14 17:09

Matthijn


People also ask

How does XDebug remote work?

When Xdebug is running, it will call back to your IDE (like PhpStorm or VS Code) from the server where it's running. Your IDE will sit and listen for that connection on a specific port (typically port 9000 or 9003).

How do I debug using XDebug?

You can find it in the extension window and install it. After installation, you must reload the VSCode window. Now, again run phpinfo(); method in any PHP file to check if Xdebug is enabled or not. Now click on the debug console tab and click on add configuration.


3 Answers

Run | Break at first line in PHP scripts -- try turning it ON and OFF few times. Sometimes it is get stuck in between: showing OFF but in reality it is ON.

If this solves your issue .. then -- http://youtrack.jetbrains.com/issue/WI-17389 -- star/vote/comment to get notified on progress. This particular moment has been fixed since PhpStorm v9.


If you still having such issue (IDE breaks an first line) and the above does not help ... then it has nothing to do with this option/answer and it's some misconfiguration at another place (missing or wrong paths mappings and stuff like that).

like image 132
LazyOne Avatar answered Oct 19 '22 23:10

LazyOne


For those who are stil having the problem, I solved mine by editing the file:

.idea/workspace.xml

and looked for the PhpDebugGeneral component and manually entered "false" to the xdebug flags there.

<component name="PhpDebugGeneral" break_at_first_line="false" ...

It looks like some leftover from the upgrade in my project.

like image 5
user3389934 Avatar answered Oct 19 '22 23:10

user3389934


You can find the option in Run menu, it's at the bottom. enter image description here

like image 20
Hieu Vo Avatar answered Oct 20 '22 00:10

Hieu Vo