Waiting for incoming connection with ide key "####" using MAMP

I've searched around the forums and found discussions about this notification when trying to use xdebug with MAMP, but none of them seemed to solve my problem. Every time I go to debug my application, I get the,  "Waiting for incoming connection with ide key" notification in the debugger window.

I'm thinking my problem has to do with how I'm trying to setup the server. I've set the server up with these settings:
Name: local
Host: 127.0.0.1
Port: 8888
Debugger: Xdebug

I'm going through a book on learning PHP, so there's a huge Start URL in the Run/Debug Configuration. Here are the settings:
Server: local
Start URL: http://127.0.0.1:8888/_learning/PHP6_AND_MySQL5/ch2/form.xhtml

And here are my xdebug settings in php.ini:
xdebug.remote_enable = 1
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req

I tried using the bookmarklets, but it seems as though they do nothing when I click on them after clicking the debug button in phpstorm. I have clicked the "Start Listen PHP Debug Connections" as well.

I've been working on this for hours now, and just can't figure it out. Any help would be MUCH appreciated =)


UPDATE:
Dumb, dumb, dumb...should've known the entry point needed to be a php file :8}   I changed that, and everything worked.

0
11 comments
Avatar
Permanently deleted user

Mike,

Also you can use only 'Listen' debug button without any run/debug configurations.
Just enable 'Listen' mode and click on a bookmarklet.

Thank you for feedback!

0
Avatar
Permanently deleted user

Hello,

try to enter your machines real IP address for "xdebug.remote_host" instead of 127.0.0.1

Cheers,

Thomas

0
Avatar
Permanently deleted user

Thank you both for your quick responses. I've used the forums here a couple of times, and the community here is always so fast and helpful.

So what I found out was that the file that is the entry point to the program needs to be a php file. When I changed the /path/to/form.xhtml to /path/to/form.php, everything works just as I would think it would. This seems to make sense to me, but I wanted to run it by everyone to make sure that's right. And after this changed was made, it doesn't even matter whether I start listening for the php session by pressing the telephone icon or not...it just works all the time now. I thought it might be working becuase I had put the xdebug.remote_autostart = 1 and xdebug.idekey = PHPSTORM into my ini file, but I have those commented out and it still works.

So my conclusion is that everything would have worked from the start with almost no configuration at all, if I would have been using a .php file as my "index" file the whole time. The only thing I would have had to do was throw in these 3 lines of code in the ini - xdebug.remote_enable = 1, xdebug.remote_host = 127.0.0.1, and xdebug.remote_port = 9000 - and that would have taken care of it. This would have at least set me up for local debugging. I'm still thinking I have some things to learn when I start debugging remotely as I'm pretty sure I don't understand how to use the bookmarklets. I went to the page to save them to my browser, hit generate (which seemed to do nothing), saved them, and when I go to use them they seem to do nothing for phpstorm. So unless someone has some good advice for me on those, I'll just cross that bridge when I get there.

Anyway, thanks again for the help and the quick responses...please let me know if any of my assumptions about this process seem off.

0
Avatar
Permanently deleted user

Mike,

Let me to describe you how PHP remote debugging with Xdebug works.

Xdebug is a php extension which works on server side. When the extension detects the special cookies or xdebug.remote_autostart setting enabled the server will try to connect to machine using xdebug.remote_host and xdebug.remote_port values.
Bookmarklets are intended to set/remove such cookies. So if should use 'xdebug.remote_autostart' setting OR bookmarklets in order to debugging with Xdebug.

Thank you for feedback!

0
Avatar
Permanently deleted user

Thank you for your hints to solve that problem but unfortunately they didn't work for me.

I use Ubuntu 10.4 and installed apache2, MySQL and PHP5 manuelly via this tutorial http://thomas-leister.de/internet/apache-webserver-mit-php-und-mysql-unter-ubuntu-12-04-installieren-und-einrichten/ (in german). I want only to debug my code on my local computer.

Therefore I installed PhpStorm and everything seemed fine. But when I debug the debugger runs from breakpoint to breakpoint but ocassionally stops and tells me that it is waiting for incoming connection with ide key '19811'
where the number 19811 changes with every exectution (seems to be a kind of process number, but I don't exactly understand that).

I appended my php-configuration. The most important parts of /etc/php5/apache2/php.ini look like this:

;zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1 ;On
xdebug.remote_autostart=off
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1 ; localhost                       
xdebug.remote_port=9000; 10137 ;9000
;xdebug.idekey="PHPStorm" ;11229" ;PHPStorm" ;"IDE_KEY"
;IDE key: PHPSTORM

I commented the zend_extension line out because I always got a warning when I ran xdebug that zend is already integrated in the php binary files (or something). I tried to give some different values for xdebug.idekey (as you can see above) but none of these were working.

Name: localhost
Host: 127.0.0.1
Port: 80
Debugger: Xdebug

I understand that xdebug starts the DBGp protocoll for the communication between my PhpStorm IDE and the PHP interpreter... What else do I have to know to solve the problem.

The suggested solutions were not practicable for me because...
- I didn't find the "Start Listen PHP Debug Connections" button
EDIT: Now I found it and will try it out now.

- It didn't make a difference wheater I inserted "127.0.0.1" or "localhost" as xdebug.remote_host (but I am not using a remoting host and work only on one computer) [Thomas Kahls suggestion]
- my entry point is a php file (index.php)

And (as you can see) all the variables are set like Mike Reilly suggested)

I am not sure what "Bookmarklets" are? Are those the same as bookmarks?
Sorry for the newbie questions but I don't know how to work on. Does anyone have an idea how to solve this problem?



Attachment(s):
phpinfo.zip
0
Avatar
Permanently deleted user

I filled in my phpinfo as I posted them at the xdebug wizard http://xdebug.org/wizard.php, followed all instructions but that didn't solve the problem.

0
Avatar
Permanently deleted user

I think I know the answer but not very sure at the moment. I had xdebug and zend installed and working at the same time. This is not possible. So I configured the php.ini so that I only use xdebug. This seems to work. But to know it exactly I have to work on it some more time.

0

Yes, there should only 1 debug engine enabled at the time.

BTW -- your phpinfo does not show signs of Zend Debugger -- I see xdebug signature only.

0
Avatar
Permanently deleted user

Perhaps the reason is the configuration instead. I'm testing a mediawiki extension. And everything works fine in the mediawiki-1.20.0 installation but not at one of the others where the mistake occured again. But I can work with that at the moment and will report if I got some new information.

The interesting thing is that my phpinfo reports me that I am using the Zend engine. But I think this is something different then the Zend debugger. Don't know what the Zend engine is for...

0
The interesting thing is that my phpinfo reports me that I am using the Zend engine. But I think this is something different then the Zend debugger. Don't know what the Zend engine is for...


http://en.wikipedia.org/wiki/Zend_Engine

0
Avatar
Permanently deleted user

Thank you!

I worked with mediawiki-1.20.0 where the debugger ran but now I want to run mediawiki-1.16.5 (to compare why our extension doesn't work with the newer mediawiki version and why it worked with the older one). So I decided to reactivate this thread again.

I'm using: Ubuntu 12.04 with PhpStorm 6.0.3 (JRE 1.6.0_27). My PhpStorm uses OpenJDK (it's known to have some issues what the Oracle JDK doesn't have (as I am always reminded when I start the program from console)).

I appended my mediawiki-1.16.5 and 1.20.6 settings.

I tried some possibilites with all the zend_engine settings of /etc/php5/apache2/php.ini (see the appended php.ini file). It worked with the 1.20 version after I commented out the zend_extension line. But in 1.16.5 it didn't work with or without that line.

Here are also some console messages when I run PhpStorm:
[  33981]   WARN -    #com.jetbrains.php.PhpIndex - Completing type '#FwfLoadExtensionMessages' took 1349ms, visited:[#FwfLoadExtensionMessages]
[  37249]   WARN -    #com.jetbrains.php.PhpIndex - Completing type '#VwgScriptPath' took 858ms, visited:[#VwgScriptPath]

Thank you for the informations about the Zend engine. OK, it is the interpreter for the PHP code. But I know that Zend also made a famous debugger which (as I mentioned above) is sometimes used, too. Some webpages explain that you should use xdebug but use the line with zend_extension so this was the reason why I was a little bit confused.

Does anyone have an idea what the reason for the different behaviour in those 2 versions is?

Thanks!



Attachment(s):
php.ini.zip
mediawiki-1.16.5-configuration.zip
mediawiki-1.20.0-configuration.zip
0

Please sign in to leave a comment.