0

I am trying to remote debug php 5.4.4 using phpStorm 4.0.3, but failed. Strangely, I can debug local PHP code normally in Phpstorm.

I'm using Xdebug v2.2.0 and my OS is Windows 8, which is the main reason cannot debug I assume. Because I can do it on Windows Server 2003, using the same configuration.

This is my configuration in php.ini:

[xdebug]
zend_extension="D:/apachePHP/PHP/ext/php_xdebug.dll"

xdebug.remote_enable   = On
xdebug.remote_host     = "localhost"
xdebug.remote_port     = 9000
xdebug.remote_handler  = "dbgp"
xdebug.auto_trace = 1
xdebug.collect_includes = 1
xdebug.collect_params = 1
xdebug.collect_return = 1
xdebug.default_enable = 1
xdebug.collect_assignments = 1
xdebug.collect_vars = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.show_exception_trace = 1
xdebug.show_local_vars = 1
hakre
  • 193,403
  • 52
  • 435
  • 836
  • What does failing mean in your case? How does that failing look like? Which errors do you get? --- [How-to: Collecting PhpStorm/WebStorm Logs](http://devnet.jetbrains.net/docs/DOC-1202) – hakre Jan 20 '13 at 16:16
  • Failing means that PhpStorm doesn't act at all when I run my web app. Normally, it will pause in the breakpoint. No error occurs.. – zhenfan0753 Jan 20 '13 at 16:21
  • Check the link I've added to my comment, enable logging and show what is happening from the logs. What you describe normally means that PHPStorm is not listening (debug client not started or port blocked) and/or that the debugging session did not yet start. So you might want to check if you're running into some network problem here first, check if ports are open and servers are running and clients are listening. http://xdebug.org/docs/remote (for general trouble-shooting), also xdebug supports logging as well. – hakre Jan 20 '13 at 16:24
  • Does phpinfo() say that xdebug is loaded? – Reactgular Jan 20 '13 at 16:25
  • Re-reading your question I'd say: Check your network configuration first. See if everything is in order that it works (Is PHPStorm listening on the right port? Does the OS allow to connect to that port?) – hakre Jan 20 '13 at 16:27
  • @MathewFoscarini phpinfo shows the xdebug module info correctly – zhenfan0753 Jan 20 '13 at 16:28
  • If you have telnet installed. Test the port. "telnet localhost 9000" – Reactgular Jan 20 '13 at 16:29
  • @hakre I'm checking all the cases you've said :) – zhenfan0753 Jan 20 '13 at 16:30
  • Related: [Step-by-step: How to do Xdebug troubleshooting connection to client IDE](http://stackoverflow.com/q/9330523/367456) – hakre Jan 20 '13 at 16:33
  • @hakre the log doesn't change when I start listen button on toolbar, but it changes when I stop the connection.It adds two lines,saying that INFO - il.connection.ServerConnection - Stopped listening on port 10137 and port 20080. Does it mean that it listened the wrong port? – zhenfan0753 Jan 20 '13 at 16:44
  • Is the debugging client listening on the right port when you press the start listen button? - And yes, the port is wrong. You probably have configured Zend Debugger instead of Xdebug in Phpstorm? – hakre Jan 20 '13 at 16:45
  • @hakre How to know wheather it is listening right port? – zhenfan0753 Jan 20 '13 at 16:46
  • See your configuration line here: `xdebug.remote_port = 9000` - This (default) xdebug client port is 9000. So the client needs to listen on port 9000. Docs: http://xdebug.org/docs/all_settings#remote_port - Also read this whole page: http://xdebug.org/docs/remote - it explains with animated images how the general process works which is very helpful for trouble-shooting. – hakre Jan 20 '13 at 16:54
  • @hakre yes,it's port 9000 – zhenfan0753 Jan 20 '13 at 16:56
  • Use TcpView to verify that PhpStorm is listening for connections on port 9000. If the port is different, you can change it [here](http://img819.imageshack.us/img819/2103/20130122130810.png). In `PHP` | `Servers` the **Debugger** needs to be [set to Xdebug](http://img607.imageshack.us/img607/2530/20130122130904.png). – CrazyCoder Jan 22 '13 at 09:09

1 Answers1

1

I use phpStorm with windows 8 + wampserver 32bit (also 64bit works) and it works, but i had to update the xedebug.dll at: http://xdebug.org/download.php

you might also need to start debuging session in browser, helpfull chrome extension: xdebug helper

there could be many causes, but one of these might be it.

Joel Harkes
  • 10,975
  • 3
  • 46
  • 65