Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm debugger not stopping at BreakPoints; keeps waiting for xdebug _SESSION_

Updated question : PhpStorm | WebMatrix (IISExpress) | Xdebug.remote_port | — Which Port(s) to put where?


I'm running localhost web server on my Windows machine with WebMatrix and IISExpress. I've installed PHP and Xdebug in it and they both are working.

I have a local WordPress install.

I'm now trying to get PhpStorm to debug it using Xdebug.

When I run PhpStorm it launches the web app in the browser with relevant debugging parameters in the browser.

IDE KEY is matching

ide

xdebug.remote_port is configured correctly. (Later I found that this is wrong, but not erroneous. It should be port 9000)

xdebug.remote_port

But it seems Xdebug never gets to communicate with PhpStorm. PhpStorm keeps listening, and the execution runs completely without stopping at any break-points.

PhpStormPhpStorm

like image 742
laggingreflex Avatar asked Jun 15 '13 05:06

laggingreflex


People also ask

How do I debug xdebug connection?

In the Settings/Preferences dialog ( Ctrl+Alt+S ), navigate to PHP | Debug and make sure PhpStorm and Xdebug / Zend Debugger are configured with the same port numbers. on the toolbar or selecting Run | Start Listening for PHP Debug Connections in the main menu.

What is xdebug PhpStorm?

PhpStorm supports the use of Xdebug in the Just-In-Time (JIT) mode so it is not attached to your code all the time but connects to PhpStorm only when an error occurs or an exception is thrown. Depending on the Xdebug version used, this operation mode is toggled through the following settings: Xdebug 2 uses the xdebug .

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).


2 Answers

These lines are crucial to make it work (in php.ini):

zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so xdebug.remote_autostart = 1 # <-------- THIS xdebug.remote_enable = 1 # <----------- AND THIS 

Without these lines xdebug will never work on phpstorm ;)

like image 57
Capy Avatar answered Sep 19 '22 19:09

Capy


Try changing the xdebug listen port in your php.ini and your IDE.

Running Mac Yosemite, for me the problem was that I installed with homebrew, following a guide that used php-fpm, which uses port 9000 by default (which conflicts with the xdebug default port)... Changing my xdebug.remote_port to 9001 and changing the xdebug port in phpstorm fixed the problem, though I suspect this issue could happen for anyone in any IDE. I googled for the better part of a day and didn't see this solution (since I believe it's so specific to install method).. but I hope it helps someone.

like image 22
peteclark3 Avatar answered Sep 21 '22 19:09

peteclark3