Connectivity issue between PhpStorm and xdebug
Hello,
I'm evaluating PhpStorm v3.0.2
I have failed to start a remote Zend debug session, so i'm trying my luck with xdebug.
After struggling for couple of hours, I dived into the logs to the communication between PhpStorm and xdebug:
Here's the log for xdebug:
Log opened at 2012-02-29 18:30:26 -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///media/app_eagle_2011_11_22/admin_console/web/index.php" language="PHP" protocol_version="1.0" appid="4025" idekey="PHPSTORM"><engine version="2.1.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2012 by Derick Rethans]]></copyright></init> <- feature_set -i 0 -n show_hidden -v 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="0" feature="show_hidden" success="1"></response> <- feature_set -i 1 -n max_depth -v 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="max_depth" success="1"></response> <- feature_set -i 2 -n max_children -v 100 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_children" success="1"></response> <- step_into -i 3 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="3" status="stopping" reason="ok"></response> <- eval -i 4 -- aXNzZXQoJF9DT09LSUVbJ1BIUFNUT1JNX1hERUJVR19CUkVBSyddKQ== -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="4"><error code="5"><message><![CDATA[command is not available]]></message></error></response> Log closed at 2012-02-29 18:30:28
and the log PhpStorm log:
2012-02-29 20:30:31,952 [ 27951] DEBUG - .connection.PhpDebugConnection - 775598#<-InitNotificationcom.jetbrains.php.debug.xdebug.dbgp.messages.InitNotification@1e28c99 2012-02-29 20:30:31,964 [ 27963] DEBUG - .connection.PhpDebugConnection - 775598#----connection started 2012-02-29 20:30:31,965 [ 27964] DEBUG - .connection.PhpDebugConnection - 775598#->FeatureSetRequestcom.jetbrains.php.debug.xdebug.dbgp.messages.FeatureSetRequest@469b16 2012-02-29 20:30:31,969 [ 27968] 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" /> 2012-02-29 20:30:31,969 [ 27968] DEBUG - .connection.PhpDebugConnection - 775598#<-SetResponsecom.jetbrains.php.debug.xdebug.dbgp.messages.SetResponse@1f35ded 2012-02-29 20:30:31,970 [ 27969] DEBUG - .connection.PhpDebugConnection - 775598#->FeatureSetRequestcom.jetbrains.php.debug.xdebug.dbgp.messages.FeatureSetRequest@b49cf1 2012-02-29 20:30:31,971 [ 27970] 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" /> 2012-02-29 20:30:31,971 [ 27970] DEBUG - .connection.PhpDebugConnection - 775598#<-SetResponsecom.jetbrains.php.debug.xdebug.dbgp.messages.SetResponse@1abc0bd 2012-02-29 20:30:31,971 [ 27970] DEBUG - .connection.PhpDebugConnection - 775598#->FeatureSetRequestcom.jetbrains.php.debug.xdebug.dbgp.messages.FeatureSetRequest@fabc3a 2012-02-29 20:30:31,973 [ 27972] 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="2" feature="max_children" success="1" /> 2012-02-29 20:30:31,973 [ 27972] DEBUG - .connection.PhpDebugConnection - 775598#<-SetResponsecom.jetbrains.php.debug.xdebug.dbgp.messages.SetResponse@15b92b3 2012-02-29 20:30:31,974 [ 27973] DEBUG - .connection.PhpDebugConnection - 775598#->StepIntoRequestcom.jetbrains.php.debug.xdebug.dbgp.messages.StepIntoRequest@5c27f0 2012-02-29 20:30:32,752 [ 28751] 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="step_into" transaction_id="3" status="stopping" reason="ok" /> 2012-02-29 20:30:32,753 [ 28752] DEBUG - .connection.PhpDebugConnection - 775598#<-StatusResponsecom.jetbrains.php.debug.xdebug.dbgp.messages.StatusResponse@7fd24a 2012-02-29 20:30:33,105 [ 29104] DEBUG - .connection.PhpDebugConnection - 775598#->EvalRequestcom.jetbrains.php.debug.xdebug.dbgp.messages.EvalRequest@1762fef 2012-02-29 20:30:33,128 [ 29127] 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="eval" transaction_id="4"> <error code="5"> <message><![CDATA[command is not available]]></message> </error> </response> 2012-02-29 20:30:33,128 [ 29127] DEBUG - .connection.PhpDebugConnection - 775598#<-ErrorResponsecom.jetbrains.php.debug.xdebug.dbgp.messages.ErrorResponse@f5d656 2012-02-29 20:30:33,136 [ 29135] DEBUG - .connection.PhpDebugConnection - 775598#---Start detaching 2012-02-29 20:30:33,136 [ 29135] DEBUG - .connection.PhpDebugConnection - 775598#---Start initializing 2012-02-29 20:30:33,138 [ 29137] DEBUG - .connection.PhpDebugConnection - 775598#---input stream is finished 2012-02-29 20:30:33,138 [ 29137] DEBUG - .connection.PhpDebugConnection - 775598#---stop reading 2012-02-29 20:30:33,145 [ 29144] DEBUG - .connection.PhpDebugConnection - 775598#->RunRequestcom.jetbrains.php.debug.xdebug.dbgp.messages.RunRequest@145af1f 2012-02-29 20:30:33,146 [ 29145] DEBUG - .connection.PhpDebugConnection - 775598#---stop writing 2012-02-29 20:30:33,146 [ 29145] DEBUG - .connection.PhpDebugConnection - 775598#----connection stopped 2012-02-29 20:30:33,146 [ 29145] DEBUG - .connection.PhpDebugConnection - 775598#---Stop detaching
I guess the issue is related to the "command is not available" response message.
PhpStorm is running on windows
Php & xdebug are running on a local ubuntu virtual machine
xdebug version 2.1.3
I'm using symlinks
Any help to further troubleshoot my issue is appreciated.
Roman
Please sign in to leave a comment.
Hello Roman,
Please check your xdebug configuration - you need to set 'xdebug.remote_mode'(http://xdebug.org/docs/remote#remote_mode) option to 'req' (it seems that now it is 'jit').
Thank you for feedback!
Thanks Nikolay,
xdebug.remote_mode is set to it's default value of "req"
The only xdebug options I changed are the following:
xdebug.remote_enable=1
xdebug.remote_host=192.168.143.1
xdebug.remote_log=/var/log/xdebug_remote.log
BTW,
I was able to run zend debugger. i think the windows firewall was blocking connections to PhpStorm's process from my virtual machine.
But I would love to see xdebug working as well.. this time I feel really close to get it up and running than any other time in the past :)
Roman,
Please attach your phpinfo() output (ensure that it corresponds to interpreter configuration installed on web server, so it is better to get phpingo() output from web page).
Thank you for feedback!
PHP Version 5.3.2-1ubuntu4.11
Copyright (c) 2006-2007 Hardened-PHP Project Copyright (c) 2007-2009 SektionEins GmbH
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.3, Copyright (c) 2002-2012, by Derick Rethans
with Zend Debugger v5.3, Copyright (c) 1999-2010, by Zend Technologies
PHP Credits
Configuration
apache2handler
Apache Environment
HTTP Headers Information
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
json
libxml
mbstring
memcache
mhash
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
Phar
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
ssh2
standard
sysvmsg
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
xsl
Zend Debugger
zip
zlib
Additional Modules
Environment
PHP Variables
PHP License
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
Thanks
Roman,
You can't use Xdebug and Zend Debugger extensions simultaneously. Please try to disable Zend Debugger extension.
Thank you for feedback!
Thanks Nikolay.
It's working perfectly now!
Hi,
I am experiencing a similar issue, and have tried the suggestions in this post without success.
I really like phpstorm and want to recommend it for general use in our company (big multinational) but after wrestling for several hours (very frustrating), I cannot get the debugging to work - a real showstopper. Judging from the forums, the complexity of getting the debugger to work with phpstorm is a major issue. Phpstorm rocks, but you have to make this debugger config simpler!
My problem:
Debugging does not stop at breakpoints.
Debugger message in PHPStorm reads: waiting for incoming connection with session id '12441'
Xdebug website reports that xdebug IS installed.
My phpinfo():
xdebug
xdebug support enabled
Version 2.1.4
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 4 4
xdebug.collect_return On On
xdebug.collect_vars On On
xdebug.default_enable Off Off
xdebug.dump.COOKIE no value no value
xdebug.dump.ENV no value no value
xdebug.dump.FILES no value no value
xdebug.dump.GET no value no value
xdebug.dump.POST no value no value
xdebug.dump.REQUEST no value no value
xdebug.dump.SERVER REMOTE_ADDR,REQUEST_METHOD,REQUEST_URI REMOTE_ADDR,REQUEST_METHOD,REQUEST_URI
xdebug.dump.SESSION no value no value
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 ewoolf no value
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 On On
xdebug.profiler_enable Off Off
xdebug.profiler_enable_trigger On On
xdebug.profiler_output_dir C:\PROGRA~1\EASYPH~1.9\xdebug\profiler C:\PROGRA~1\EASYPH~1.9\xdebug\profiler
xdebug.profiler_output_name cachegrind.out.%s.%t cachegrind.out.%s.%t
xdebug.remote_autostart Off Off
xdebug.remote_connect_back On On
xdebug.remote_cookie_expire_time 3600 3600
xdebug.remote_enable On On
xdebug.remote_handler dbgp dbgp
xdebug.remote_host 127.0.0.1 127.0.0.1
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 On On
xdebug.show_mem_delta On On
xdebug.trace_format 0 0
xdebug.trace_options 0 0
xdebug.trace_output_dir C:\PROGRA~1\EASYPH~1.9\xdebug\trace C:\PROGRA~1\EASYPH~1.9\xdebug\trace
xdebug.trace_output_name trace.%t trace.%t
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth 3 3
My php.ini:
zend_extension = "C:\PROGRA~1\EASYPH~1.9\\xdebug\php_xdebug-2.1.4-5.3-vc9.dll"
xdebug.default_enable=0
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart = false
; added ecw Thu 03/29/2012 09:18
xdebug.remote_connect_back=On
xdebug.dump_globals=1
xdebug.dump=COOKIE,FILES,GET,POST,REQUEST,SERVER,SESSION
xdebug.dump.SERVER=REMOTE_ADDR,REQUEST_METHOD,REQUEST_URI
xdebug.show_local_vars=1
xdebug.show_mem_delta=1
xdebug.collect_includes=1
xdebug.collect_vars=1
xdebug.collect_params=4
xdebug.collect_return=1
xdebug.auto_trace=0
xdebug.trace_options=0
xdebug.trace_format=0
xdebug.trace_output_dir="C:\PROGRA~1\EASYPH~1.9\\xdebug\trace"
xdebug.trace_output_name="trace.%t"
xdebug.profiler_enable=0
xdebug.profiler_append=1
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir="C:\PROGRA~1\EASYPH~1.9\\xdebug\profiler"
xdebug.profiler_output_name="cachegrind.out.%s.%t"
;/Xdebug
My setup could not be simpler:
Local WAMP server (EasyPHP 3) and local development in the www root folder.
I have attached my phpstorm debug config (which seems to be working) and the actual php file I am using.
Other notes:
1. I am an application programmer - I am not so experienced with these settings
2. I remember seeing a question in phpstorm about xdebug or zend debugger - no idea where to find that now...
3. Nikolay made a comment abouut having to disable zend debugger: I have no idea what that means. What do I need to do?
The xdebug website instructions say set:
zend_extension = "C:\PROGRA~1\EASYPH~1.9\\xdebug\php_xdebug-2.1.4-5.3-vc9.dll"
which I have done and xdebug seems to be working - is this correct?
4.I have tried several suggestions in other posts:
xdebug.remote_connect_back=On (I also tried xdebug.remote_connect_back=1) - made no difference.
5. I am using latest EAC release candidate - I had no choice, the version I downloaded from main site did not recognize my local functions or include_once references and reported "not found" all the time - unusable.
This has been a long post, but I figure you'd rather have the complete picture.
Please understand: I have put in much effort and would really like to get this resolved so that I can introduce your product into our company.
Thank you,
Ed
Attachment(s):
Phpstorm -debugger not working.doc
I forgot to mention:
I have run http://www.jetbrains.com/phpstorm/marklets/ in firefox and clicked on generate, then on Start debugger link.
Hi Ed,
Most of the time it has nothing (or very little) to do with PhpStorm -- it's improperly configured (or not even installed) xdebug. Just today I was replying to somehow similar thread
So far xdebug config seems to be OK. Try settings up value for xdebug.remote_log -- this will help with decising if xdebug is trying to connect to PhpStorm or not (and if it does, what the possible reason may be -- not responding, declined).
Hello Ed,
Do you still have the issue?
Thank you for feedback!
Andriy,
Thanks for assistance!;)
Hi Nikolai,
Thanks for the follow-up.
The problem is not solved - I gave up in frustration - could not get past the "waiting for input" message in the debugger. I even tried changing ports from 9000 after telnetting to find open ports - all in vain.
So maybe the issue is related to my laptop's security and windows.
I also have a LAMP setup on an Amazon Web services (AWS) EC2 cloud and was going to try again but then I read this article:
http://stackoverflow.com/questions/9815243/trouble-shooting-phpunit-xdebug-remote-debugging-with-phpstorm
- seems to be similar problem?
I'm not able to spend the time testing (again) so:
If you can point me to clear instructions on using phpstorm and xdebugger on a remote linux server, I'll have a look, otherwise, I'm afraid it's back to eclipse!
Hi there,
The stackoverflow thread you mentioned -- the same thread here: http://devnet.jetbrains.net/message/545529
If that is the case then disable firewall .. or grant full network access for PhpStorm. Also, I hope you are not running PhpStorm and other PHP IDE at the same time (2 different applications cannot listen on the same port:ip pair).
Is this "remote linux server" next to you (same LAN) .. or it's on internet. If second -- you will have to use port forwarding on your router and/or deal with ssh tunelling (maybe even xdebug proxy, dunno).
For "clear instructions" you have to clearly describe your setup (in details). But ... if you cannot solve local debug (web server is on the same computer as IDE), then I see no much point jumping straight into remote debugging: easier part first and then more complex stuff.
Usefull to have (for Nikolay to give you better advice):
Hi Andriy,
I appreciate the prompt response. Sadly I do not have the time resources this week.
I will be installing onto a different laptop next week, and will revert on my progress. I'll look at the links.
It is a very common requirement to debug on a remote server, and if this is more complicated case, then I may be out of my depth here.
FYI The Amazon Web Service instance is a virtual dedicated box, i.e. I have bash and ftp access and can pretty much control it.
I don't have advanced skills on port tunnelling.
Thanks,
Ed
Hi Ed,
From PhpStorm side the change between Local WebServer debug and Remote WebServer debug is minimal -- depending on your project setup it can be just 1 single setting change (like, host name etc), but configuring your remote server (xdebug) and your own pc/network (firewall, router port forwarding/ssh tunneling etc -- depends on your remote server) is a different thing that has no relation to PhpStorm (as it can be any IDE here).
That's why I suggest to start from making local CLI mode (PHP Script run configuration type) debug working first -- this will ensure that xdebug is configured properly + you will know what needs to be done in PhpStorm to make it work. Once you have done that you should have no issues with continue further (yeah, initiating debug session for web server debug is a bit different, but there are at least 3 ways of doing it in PhpStorm). All this needs to be done on brand new and very simple project (1 or 2 simple scripts to start with).
On related note -- check this thread (when you will have time, of course): http://devnet.jetbrains.net/thread/435271?tstart=0
And then continuation: http://devnet.jetbrains.net/thread/435332?tstart=0
Hi, Ed,
Do you still have the issue?
Thank you for feedback!
Hi Nikolay,
I do still have the issue.
I recently changed jobs and just yesterday I tried to get xdebug working again in my new environment.
My issue is simple: the debugger does NOT stop at any breakpoints. It's very very frustrating.
The debugger in PHPStorm shows I am connected to my server. I have tried checking and unchecking enable path names for the server - no difference - still no stop on breakpoints. Reveal log in explorer shows idea.log is empty (?) - I deleted it to clear out other crap before I started latest tests but expected it to show something?
My current config is ubuntu remote server running php 5.3, xdebug is enabled for an older version: I am not in a position to change the php server environment.
My php.ini:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans
It might fix things to change php server xdebug settings and latest install but I see on the forums that some others are having the same issue of the debugger not stoppng at breakpoints. Xdebug developer Derick Rethans said he just released a RC of xdebug to address this but user said didn't work. In fact, latest release of xdebug seems to have stability problems, judging from the bug list, so:
I am going to keep monitoring the forums (xdebug and this one) but will hold off trying to get this working until xdebug settles down again. I can't afford to get bogged down on this issue in a new job :-)
I really think that PHPStorm is an excellent product and your support has been excellent too. That's why I want to get the damn debugger working!!
In truth, though, the interface to set up the server and debugger needs to be redone - there are so many paths to set up to map server and client - very confusing and what each setting is for is really not properly explained. I was wondering: what's this for now? a lot of times! A few example configuration would help enormously, but frankly the whole config is overly technical (in the interests of being flexible I know, but simply serves to confuse here) and needs to be greatly simplified.
I would be happy to assist you with the documentation- but first I need to get the product working so that I can use it at work first.
If there is any further news of the Xdebug issue, I know you will keep me posted :-)
Best regards
Edwin
Hi, Ed,
Please provide your Xdebug remote log (xdebug.org/docs/remote#remote_log). I really need to dive into your issue.
Thank you for feedback!
Ed,
Any progress here?
Thank you for feedback!