Configuring PhpStorm + XDebug

I've read through the various articles in this forum and cannot find one that solves my problem. This is the first time I've used XDebug, so please forgive if these are trivial questions.

First, the prerequisites:
- IDE: PhpStorm
- Server: Debian Lenny with PHP 5.3.10 (xdebug module loaded) and Apache 2.4
- Must tunnel XDebug over SSH
- Multiple developer environment at multiple locations
- Using pydbgproxy for handling DBGp

Here's my XDebug configuration on the server:

Set up PHP Remote Debug in the IDE:
The register IDE successfully

Here are the step that I take to set a breakpoint:

1. SSH into server, launch pydbgproxy
2. Start an SSH tunnel using: ssh -L 9001:localhost:9001
3. Set up PHP Remote Debug in the IDE:
     IDE key: PHPSTORM
     Register IDE (this is successful)
3. Launch editor, set break point on first line
4. Start debug in IDE, message says "Waiting for incoming connection with ide key 'PHPSTORM'"
4. In browser, go to my page (at which the breakpoint lies), append XDEBUG_SESSION_START=PHPSTORM to the URL

Nothing happens. Any ideas of what I'm doing wrong?


Hi Andrew,

Have you seen this thread? It has some general links on this subject + info on issues that person had and how he sorted it out:

Another possible reason: path mappings (that's when xdebug connection is successfull, but no path mappings is setup and PhpStorm is unable to figure out which file is requested).

About your workstation OS -- it's xdebug/proxy who initiates connection so maybe your local firewall is blocking connection. Can you connect from server (or another place) to your computer (where you have PhpStorm running) on Xdebug port (using telnet, for example)?


I've tried the wildcard route and it's still not working. I've also set up the path mappings properly as far as I know.

As far as the connection back goes, I'm using an SSH tunnel to handle this, and I want the debugger proxy to connect to the localhost as it's doing:

INFO: dbgp.proxy:     dbgp listener on
INFO: dbgp.proxy:     IDE listener on
INFO: dbgp.proxy: Server:onConnect ('', 51176) [proxyinit -p 9000 -k PHPSTORM -m 1]


Unfortunately I have nearly zero experience with SSH & tunneling and cannot be of help here.

If it's possible -- just for testing purposes -- can you try setting it up without SSH tunnel (make some virtual server and test there). First: without any proxy (maybe the mistake is in xdebug proxy configuration). When everything is working -- do with proxy. next --  try with SSH. Possibly it's some misconfiguration (or even incorrect approach) when using SSH (or just small typo somewhere). I think -- if it does not work as desired straight away (and I did not had such previous experience), then I would start with simplest thing, make it work and then move to next milestone.

Another thought (although very unlikely as you seems to know what you are doing) -- xdebug / xdebug proxy is the one that initiates connection to debug client (PhpStorm). Maybe (just maybe) your local firewall (or firewall on router or whatever else you may have there) does not allow creating incoming connection on xdebug port?


If you still will not be able to resolve it here, then I may suggest asking this question on ServerFault ( ) or StackOverflow ( )

Maybe you have see these already:


phpstorm still listens on port 9000 not 9001

i think you need to fix your port forward
ssh -L 9001:localhost:9001

or change your xdebug listen port in phpstorm:
Project Settings -> PHP -> Debug -> Xdebug -> Debug Port

did you configured your path mappings in phpstorms server config?
Edit: just read you did. it should look something like /srv/www/domain/htdocs/

just noticed there is a xdebug proxy configuration (never needed to use this yet ;) )
Project Settings -> PHP -> Debug -> Xdebug Proxy

did you configured this to your needs?  


Hi, Andrew,

Do you still have the issue with debugging?

Thank you for feedback!


Hi Nikolay,

Yes, I've temporarily given up on that approach and run the development site locally with XDebug. However, I would still like to centralize development with the aforementioned requirements.



Did you try to debug your remote application without pydbgp? Let's try to find out the cause of your problem. First of all we need to be sure that it isn't the pydbgp who breaks the workflow.

Please set up your Xdebug using the following configuration:

xdebug.remote_host=<IP of your PC>
xdebug.remote_port=<port on your local PC>

Then please try to initiate a debug session and let me know about results.

Thank you for feedback!


I created a tutorial based on a smattering of information I found on these support forums and the web.

Hopefully it saves someone time!  Comments welcome.


Thanks! Your contribution is appreciated!
We also tweeted about it from @webide


Thanks for checking out the tutorial and thanks for the tweet.  I'll follow you.


Please sign in to leave a comment.