Cannot connect to xdebug proxy


I'm trying to setup PHP debugging with Xdebug but I'm having trouble getting PhpStorm to connect to the xdebug proxy. When I go to Tools | Xdebug Proxy | Register IDE I get the following error notification:

Cannot connect to xdebug proxy on ''

Does anyone know why it would be unable to connect? Considering the info below, the problem definitely seems to be PhpStorm not registering with the proxy.

More info:

I'm using the pydbgpproxy on the remote server. Output from pydbgpproxy when I start it:

$ python pydbgpproxy
INFO: dbgp.proxy: starting proxy listeners.  appid: 6937
INFO: dbgp.proxy:     dbgp listener on
INFO: dbgp.proxy:     IDE listener on

When I load a PHP page in a browser, I get this output from pydbgpproxy (I believe that this is because PhpStorm could not register itself with the proxy):

INFO: dbgp.proxy: connection from [<__main__.sessionProxy instance at 0x14ea488>]
WARNING: dbgp.proxy: No server with key [smm11], stopping request [<__main__.sessionProxy instance at 0x14ea488>]
INFO: dbgp.proxy: session stopped

I noticed that there might be a problem with keys being mismatched so I tried all sorts of possible ones and all give the same result. (?XDEBUG_SESSION_START=xxx)



; This gets overridden to 'root' (I can see this in phpinfo()), I've tried using both in the URL params.


Some additional info:
-without the dbgp proxy, I can debug in Vim with the dbgp plugin
-multiple developers working on one project
-can't use xdebug.remote_connect_back because of security and because we're using Varnish
-developers work locally in PhpStorm and use automatic FTP to sync files on remote server
-apache httpd serves each dev's workspace on the remote server

Hello smm,

Sorry for delay.

Does anyone know why it would be unable to connect? Considering the info below, the problem definitely seems to be PhpStorm not registering with the proxy.

One of our users developed a simple php script which helps to register an IDE in xdebug proxy -
Please try to register PhpStorm using the script. It will help us to understand whether the problem related to PhpStorm or not.

Thank you for feedback!


Thanks for the response! I get the following warning when I run the script:

Warning: fsockopen(): unable to connect to (Connection refused) in /Users/me/Documents/projects/PHPDebugger/manualRegister.php on line 9



Please check your server hostname. Do you have any software running on server which can refuse incomming connections?

Thank you for feedback!


I've tried registering multiple times, with the server's IP address and with the hostname.

I'm not sure what software would refuse incoming connections. (Also, if I didn't mention earlier, the server is running Linux.) I am able to ssh to the server from my local computer. I tested the IDE listener port by starting an ssh daemon listening on port 9001 and I was able to ssh through that port. I did notice something odd with nmap though:

$ nmap -p 9001 xx.xx.xx.xx

Starting Nmap 4.11 ( ) at 2011-07-21 21:58 PDT
Interesting ports on xxxxxxxxxxxxxxxxxxxxxxxxxxxx
9001/tcp closed unknown

Nmap finished: 1 IP address (1 host up) scanned in 0.116 seconds

I'm not sure, but it looks like the proxy script is not listening.



I found related topic - (item 5)
Could it help you?

Thank you for feedback!


Thanks for the link, I will give that a shot...

EDIT: That worked, I ran the following SSH command on my local machine that I use PhpStorm on:

ssh -L 9001:localhost:9001

Where is the IP address of the server running the DBGp proxy script. Then in PhpStorm, under Tools -> Xdebug Proxy -> Configuration I used:

IDE key: mykey
Host: localhost
Port: 9001


Please sign in to leave a comment.