cannot connect with xDebug

I have spent last 3 hours trying to get debugger working.

phpStorm  #PS107.120, running on windows7 x64

phpinfo():

xdebug

xdebug support enabled
Version 2.1.1

XDEBUG NOT LOADED AS ZEND EXTENSION

Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $

Directive Local Value Master Value
xdebug.auto_trace Off Off
xdebug.collect_assignments Off Off
xdebug.collect_includes On On
xdebug.collect_params 0 0
xdebug.collect_return Off Off
xdebug.collect_vars Off Off
xdebug.default_enable On On
xdebug.dump_globals On On
xdebug.dump_once On On
xdebug.dump_undefined Off Off
xdebug.extended_info On On
xdebug.file_link_format no value no value
xdebug.idekey RayZ RayZ
xdebug.manual_url http://www.php.net http://www.php.net
xdebug.max_nesting_level 100 100
xdebug.overload_var_dump On On
xdebug.profiler_aggregate Off Off
xdebug.profiler_append Off Off
xdebug.profiler_enable Off Off
xdebug.profiler_enable_trigger Off Off
xdebug.profiler_output_dir \ \
xdebug.profiler_output_name cachegrind.out.%p cachegrind.out.%p
xdebug.remote_autostart Off Off
xdebug.remote_connect_back Off Off
xdebug.remote_cookie_expire_time 3600 3600
xdebug.remote_enable On On
xdebug.remote_handler dbgp dbgp
xdebug.remote_host localhost localhost
xdebug.remote_log no value no value
xdebug.remote_mode req req
xdebug.remote_port 9000 9000
xdebug.scream Off Off
xdebug.show_exception_trace Off Off
xdebug.show_local_vars Off Off
xdebug.show_mem_delta Off Off
xdebug.trace_format 0 0
xdebug.trace_options 0 0
xdebug.trace_output_dir \ \
xdebug.trace_output_name trace.%c trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth 3 3


Running with "Denwer". It seems like xdebug configured properly.
So, i guessed, something is wrong in my phpstorm configuration.

PHP Settings: attached php.png
PHP -> Debug Settings: attached php-debug.png
PHP -> Debug Proxy Settings: php-debug-proxy.png

Them i create debug profile - attached project-debug-profile.png

I assumed that you have configured everything correctly, but debugging still doesn't works for me
Pressing "xdebug this page" bookmarklet in Firefox makes blinking "Waiting for incoming connection with ide key ..." message for a couple times (attached file phpstorm-debug.png).
And it still does nothing,
Please, help!

Thank you in advance!



Attachment(s):
phpstorm-debug.png
project-debug-profile.png
php-debug-proxy.png
php-debug.png
php.png
13 comments

Hi Andrew,

How did you setup your ADAMARK server in "Settings | PHP | Server" -- taken from project-debug-profile.php ? There may be an issue with mappings ... or incorrect host/port values. Also please double check that IDE Key used in bookmarklet matches the one you are using in PhpStorm.

So far it all seems to be OK (at least I have not spotted anything big on screenshots provided so far). I recommend:
0) Ensure that you have properly setup deployment server at Settings | Deployment (to match URL to local file structure) -- not 100% sure if that is required, but worth checking
1) Delete the server entry ADAMARK completely from Settings | PHP | Server
2) Enable "Break at the first line (for external connections)" option at Settings | PHP | Debug
3) "Activate "Run | Start listen PHP Debug Connections" (that red phone icon on toolbar should turn green)
4) Start debugging session (via bookmarklet, or browser extension, or manually) in browser.
5) If all fine so far PhpStorm should bring popup window asking for a mapping ...

If there are mapping issues (as Denwer, if I remember correctly, using Z:\ path but physically files may be located like C:\denwer\www) you can check the paths from phpinfo() output & thing like echo realpath(__FILE__);

Also please ensure that PhpStorm can accept incoming connections on the Xdebug port (check your firewall/antivirus). Make sure that PhpStorm is the one who listen on that port (screenshot shows that it listens, but please check if still nothing).

I had no issues setting it up and making it work under Apache on Win XP & IIS 7 on Win 7 x32 & x64 (+ KIS 2011).

0

PHP -> Server settings screenshot is attached. There is no any mappings. Host taken from $_SERVER['SERVER_NAME'], and port from  $_SERVER['SERVER_PORT']. Bookmarklet IDE Key is RayZ as seen on phpinfo page.

0) Deployment settings is ok, i guess. Anyway i attached deployment settings screenshots. (deployment-mappings.png, deplyment-connection.png)
1-4) Ok  5) No dialogs appeared as suggested.

Anyway, server running on localhost. I have MS Security Essintials and Windows 7 firewall.

$netstat -a-n-b
[PhpStorm.exe]  TCP    0.0.0.0:9000           0.0.0.0:0              LISTENING
[PhpStorm.exe]  TCP    0.0.0.0:10137          0.0.0.0:0              LISTENING
[PhpStorm.exe]  TCP    [::]:9000              [::]:0                 LISTENING
[PhpStorm.exe]  TCP    [::]:10137             [::]:0                 LISTENING
[PhpStorm.exe]  TCP    [::]:20080             [::]:0                 LISTENING
[PhpStorm.exe]  UDP    [::]:50680             *:*
[PhpStorm.exe]  UDP    192.168.1.129:53884    *:*
[PhpStorm.exe]  UDP    [::]:9876              *:*


Everythink seems ok.



Attachment(s):
deplyment-connection.png
deployment-mappings.png
php-server.png
0

maybe it helps, but when i clicking bookmarklet "xdebug" This page, phpstom's debug area message "Waiting for incoming connection with ide keya RayZ" blinking once. It's reacts to "click" event

0

Hi Andrew,

In general it all seems to be OK -- cannot see anything wrong here (at least from config point of view)...

Few more attempts:
1) Enable "xdebug.remote_autostart = 1" and "xdebug.remote_connect_back = 1" so Xdebug will attempt to establish debug session on every page request (you will have about 1 sec delay before the script actually starts executing (while xdebug tries to establish the connection) but this will simplify things a bit for now).

2.1) Enable logging (one or both of the bellow):
* on Xdebug side via xdebug.remote_log
* on PhpStorm side as described here
2.2) Attach those logs here (or have a look yourself and see if you spot something unusual)

maybe it helps, but when i clicking bookmarklet "xdebug" This page, phpstom's debug area message "Waiting for incoming connection with ide keya RayZ" blinking once. It's reacts to "click" event

Can't say for sure -- maybe PhpStorm is receiving debug connection but finds no file to debug ... (wrong paths (symlinks?) maybe --- need to see the logs)

0

As I understand you have read the debug manuals already: http://confluence.jetbrains.net/display/WI/Documentation
If not -- have a look and see if you do anything differently compared to the process described in manuals.

0

Sure. A lot of times.

Xdebug installation guide - done well. Installed properly. Xdebug working well as we can see on phpinfo page;

BTW, easy Xdebug doesn't works properly with FF4 for me (extension can't save ide key settings from it's dialog). This extension makes this settings from about:config page, so i found another extension later - Xdebug-assistant. This one works properly i guess.

It still makes no sense for my problem.

0

current PHP.ini xdebug settings

[xdebug]
zend_extension_ts = /usr/local/php5/ext/php_xdebug-2.1.1-5.3-vc6.dll
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.idekey = RayZ
xdebug.remote_connect_back = 1
xdebug.remote_autostart = 1
xdebug.remote_log = /tmp/xdebug.log


Eclipse PDT accepting debug session with the same settings.

phpStorm log tail:

2011-05-21 14:55:37,724 [ 189218]   INFO - hp.connection.ServerConnection - StartingXDebug on port 9000
2011-05-21 14:55:37,725 [ 189219]   INFO - hp.connection.ServerConnection - StartingZend Debugger on port 10137
2011-05-21 14:55:37,725 [ 189219]   INFO - hp.connection.ServerConnection - StartingZend Debugger Settings Broadcasting on port 20080
2011-05-21 14:55:47,472 [ 198966]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/runner.layout.xml file is null
2011-05-21 14:55:47,472 [ 198966]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/runner.layout.xml
2011-05-21 14:55:52,609 [ 204103]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:52,619 [ 204113]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/fileColors.xml file is null
2011-05-21 14:55:52,619 [ 204113]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/fileColors.xml
2011-05-21 14:55:52,683 [ 204177]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:53,286 [ 204780]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:53,367 [ 204861]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:53,470 [ 204964]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:53,566 [ 205060]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:53,646 [ 205140]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:53,672 [ 205166]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:53,806 [ 205300]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:53,869 [ 205363]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:53,966 [ 205460]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:54,072 [ 205566]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:54,138 [ 205632]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:54,171 [ 205665]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:54,279 [ 205773]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:54,377 [ 205871]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:54,806 [ 206300]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:54,881 [ 206375]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:55,014 [ 206508]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:55,083 [ 206577]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:55,182 [ 206676]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:55,284 [ 206778]   INFO - hp.connection.ServerConnection - ----socket closed
2011-05-21 14:55:55,349 [ 206843]   INFO - hp.connection.ServerConnection - Incoming connection on port 9 000 from 127.0.0.1
2011-05-21 14:55:55,386 [ 206880]   INFO - hp.connection.ServerConnection - ----socket closed

0

I see you are using *nix paths on Windows machine (not just a directory separator, but the whole path)... did not know that it will work (unless Denver etc can handle this somehow)


Anyway -- it looks like you have not entered the correct data to enable PhpStorm logging. Based on the log content provided you have entered like this:

  <category name="com.jetbrains.php.debug">
    <priority value="DEBUG"/>
  </category>

while it should be like this (notice the # sign)

  <category name="#com.jetbrains.php.debug">
    <priority value="DEBUG"/>
  </category>

The log entries should look like this (much more detailed):

2011-05-21 12:24:20,612 [  14995]   INFO - hp.connection.ServerConnection - Incoming connection on port 9,000 from 127.0.0.1
2011-05-21 12:24:20,646 [  15029]  DEBUG - .connection.PhpDebugConnection - 28068610#<-InitNotificationcom.jetbrains.php.debug.xdebug.dbgp.messages.InitNotification@a89109
2011-05-21 12:24:20,652 [  15035]  DEBUG - .connection.PhpDebugConnection - 28068610#----connection started
2011-05-21 12:24:20,653 [  15036]  DEBUG - .connection.PhpDebugConnection - 28068610#->FeatureSetRequestcom.jetbrains.php.debug.xdebug.dbgp.messages.FeatureSetRequest@104fdb1
2011-05-21 12:24:20,654 [  15037]  DEBUG - bug.dbgp.messages.DbgpResponse - <?xml version="1.0" encoding="UTF-8"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="0" feature="show_hidden" success="1" />
2011-05-21 12:24:20,654 [  15037]  DEBUG - .connection.PhpDebugConnection - 28068610#<-SetResponsecom.jetbrains.php.debug.xdebug.dbgp.messages.SetResponse@12112be
2011-05-21 12:24:20,655 [  15038]  DEBUG - .connection.PhpDebugConnection - 28068610#->FeatureSetRequestcom.jetbrains.php.debug.xdebug.dbgp.messages.FeatureSetRequest@10a93ea
2011-05-21 12:24:20,655 [  15038]  DEBUG - bug.dbgp.messages.DbgpResponse - <?xml version="1.0" encoding="UTF-8"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="max_depth" success="1" />
2011-05-21 12:24:20,655 [  15038]  DEBUG - .connection.PhpDebugConnection - 28068610#<-SetResponsecom.jetbrains.php.debug.xdebug.dbgp.messages.SetResponse@17525bb

Please also provide xdebug's own log as well (content of file fromxdebug.remote_log) -- I'm interested in first request sent by xdebug -- it should show which file it tries to debug.

0

Andrew,

Judging by logs xdebug set up correctly and phpstorm accepts debug connections from xdebug. As you are using 'Denwer' the problem should be in mappings.

Here is an example of debug configuration for Denwer:

Remote debug run configuration:
remote_debug_run_configuration.png

Server configuration:
denwer_server_configuration.png

Also notice that if you are using bookmarklets you can override ide_key value setted in php.ini. The default ide_key value in bookmarklets generator is PHPSTORM:
bookmarklet_generator.png

'Remote debug' run configuration checks the value of ide_key setting, so if the value is wrong your connection will be ignored.
We suggests avoid using of 'Remote Debug' run configuration and use 'Listen debug connections' button instead.
Just enable listening mode:
listen_debug_connection.png
See details in: http://confluence.jetbrains.net/display/WI/Zero-Configuration+debugging+with+PhpStorm+2.0

Thank you for feedback!

0

Andrew,

Do you still have the issue?

0

Try xdebug helper.
It works okay with one tiny exception - it's not installing on ff >= 3.0. But you can fix it's xpi and it works fine.

0

Hello dmitry,

Thanks for sharing!
Also you can try Xdebug bookmarklets - http://www.jetbrains.com/phpstorm/marklets/.

0

Have same issue. And also spent about 3 hours for solution finding :)
As I understand that idkey must be in the quotes. At least it was the reason of problem.
Try
xdebug.idekey = "yourKey"

0

Please sign in to leave a comment.