Xdebug does not work (waits for connection)
Hi,
I'm trying to setup xdebug with PhpStorm and it won't work... it did work with NetBeans and Eclipse before, so there needs to be some configuration error in my PhpStorm settings.
All of this runs on the same machine, so the project folder does not need to be synced.
My settings:
http://dl.dropbox.com/u/256059/tmp/phpstorm/deployment.jpg
http://dl.dropbox.com/u/256059/tmp/phpstorm/debug_config_1.jpg
http://dl.dropbox.com/u/256059/tmp/phpstorm/debug_config_2.jpg
xdebug log: http://pastebin.ca/1960751
According to the xdebug log PhpStorm and xdebug DO communicate - they even exchange the breakpoints, but except of this nothing happens... PhpStorm stays in the "Waiting for connection on port 9000 with ide key 'PhpStorm'"-mode.
I tried this in the newest EAP and in the stable. Both didn't work.
Edit: Added some more tags after solving the problem
请先登录再写评论。
Hi Sven,
On screenshot #3 I see that you have "Wait for connection with ide key" option selected. This means that debugging session must be initiated manually from outside PhpStorm -- from your browser.
If you want to start debugging from within PhpStorm (for that specific page) -- just choose "Open web page in browser" option instead. It will launch the page in browser and initiate debugging session automatically. Make sure that you have at least one breakpoint setup or "Break at the first line" option selected, otherwise debugger will not kick in (as there is no reason for debug) -- this goes for both options -- this and below.
If you want use "Wait for connection with ide key" option (which will allow you to debug complex applications much easier IMO, for example those that have SEO friendly URLs as well as specific scrip execution scenarios (where script parameters matters a lot) ) -- then you have to initiate session from outside. I see you use Chrome browser. Here is extension which I use myself -- does the job perfectly: Xdebug helper https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc -- very easy to configure and use. But you may use another extension if you wish (I remember seeing more than one). Similar extensions exist for Firefox as well.
Hi Andriy,
I did that on purpose. I already use the extension you mentioned and if you take a look at the xdebug log you can see that the debug session is indeed initiated by the browser.
I also tried the other debug method your described and it does the same... the log shows that PhpStorm and xdebug communicate and PhpStorm itself does nothing but waiting for a connection.
Hi Sven,
I saw the log -- but could not make anything useful of it (I'm not a JB dev and have not seen any xdebug-PhpStorm logs before, so it's difficult for me to judge how successful it is).
By looking at the log I have found one thing which attarcted my attention:
and
I guess it's the same file -- but they are on different drives (E and W) -- do you use some symbolic link/junction point or drive mapping ?? I personally pretty sure that is the reason. Can you setup your project so that all files are on the same drive (at least temporarily ... or create an empty project with very simple php script -- easier) and run debug there ?
Hi Andriy,
right after my answer I also noticed that. I do indeed use NTFS symlinks (W: is an encrypted truecrypt volume for company projects)
After setting an override from W:\... to E:\Entwicklung\... everything works.
I wonder why I didn't notice this as I edited the project names out of the paths...
Thats what I get for using advanced filesystem functions! ;)
Hello all,
Just to confirm Andriy's answer, the problem was with symbolic links you use. Unfortunately, they are sometimes handled incorrectly (http://youtrack.jetbrains.net/issue/WI-600).
Current workaround is to provide debugging path overrides in 'PHP on server' run configuration dialog -> Debug -> 'Server path mappings' dialog:
Regards,
Kirill
PS Gratitude to Andriy for his answers, we appreciate that! :)
Hi,
I have similar problems as well. The debugger does not jump to the breakpoint when I launch my URL that contains the swf that communicates to the remote services. I have a Flex remoting setup with amfphp where it is not possible to trigger the debugger by launching an HTML page from PHPStorm, so I use an ide key of "PhpStorm1", that is also in my MAMP php.ini:
[xdebug]
zend_extension="/Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=PhpStorm1
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/Applications/MAMP/bin/php5.2/zend/lib/Optimizer-3.3.9
zend_optimizer.version=3.3.9
;zend_extension=/Applications/MAMP/bin/php5.2/zend/lib/ZendExtensionManager.so
What I'm trying to figure out is how should I set up my configuration. Here's my simple setup:
File to trigger the debugger (this is the client running on the localhost:8888):
Applications/MAMP/htdocs/project/folder1/folder2/folder3/folder4/folder5/pageContainingSWF.php
File to debug (this is the php file that retrieves data from the db):
Applications/MAMP/htdocs/services/remote.php
I tried many configurations with PHP On Server option, but none of them work. I would love to see it work either with PhpStorm or IDEA. I know it's possible because some people on this forum have already done it. Please advice, as I have run out of ideas ;-)
Thanks in advance,
Tim
Hello Timur77,
It looks like you have a problem with xdebug installation. Have you tried "validate xdebug before run" option?
You can also examinate phpinfo() output - it should contain 'XDebug' section.
Hello Nokolay,
Unfortunately I have validate xdebug before run option checked and phpinfo() output contains:
xdebug
As I've said, I can't think of anything else.
Tim
Timur77,
I noticed the following in your settings - you have different Local and Master Values for xdebug.idekey settings.(Look at attached picture).
Please try to set ide key setting in PhpStorm to "timmyk".
Attachment(s):
xdebug_idekey_local_value.png
THAT'S IT!!! It worked. Wow, thanks a million! OK, next question, if I got this to work in PhpStorm, will this be possible in IDEA 10? Since I work with Flex & PHP, IDEA would be a more flexible approach.
Tim
Basically yes. But IDEA 10 release has almost the same PHP plugin as PhpStorm 2.0 EAP 98.521 - and its lacking some of recent features that you was just taught to use. It will get updated PHP plugin in 10.0.x releases/EAP builds.
Do you mean features like "Wait for Xdebug connection with ide key:"? It seems it was available in IDEA 9.x.x in one of the videos, but then was removed. Is there an ETA on the update for IDEA PHP plug in?
Thanks,
Tim
Nope, I mean all what you can see *now* in PhpStorm 2.0 EAP. 9.0.x has only PhpStorm 1.0 features.
No ETA.
You can roughly compare build features by full build numbers: 98.521 (Prev 2.0 EAP) > 99.14 (IDEA X) > 100.36 (Current 2.0 EAP)