Remote debugging with local code

I primarily develop on a local environment, and debugging works fine there.

I would like to occassionally be able to debug a remote environment against my local code.  

For example, my local web server project is http://example with my files in: ~/projects/example/public_html

I integrate onto a development environment on a remote server at

I would like to use Chrome to navigate to, activate an xdebug session, and step through the local project code but using the remote db.

I used to do this with another IDE and XDebug, although the details are foggy.

Is that possible with PHPStorm?  If so, any direction would be appreciated.

Comment actions Permalink

Hi there,

1) You should have xdebug installed and enabled on remote server

2) You need to make sure that xdebug can connect to YOUR computer on xdebug port (xdebug is the one who initiates debug connection and not IDE) -- so you need to enable PhpStorm in your firewall / do port-forwading (on your router) if you are behind the router

3) Follow one of the numerous manuals that can be found on internet, for example:

Comment actions Permalink

Thanks, I thought my local router config was port forwarding properly, but I took another look and just made my system the dmz host to rule out a bad config.  That worked, so it's with my route rconfig.

Also, for anyone else that may be finding this, there was one more setting:

Preferences -> PHP -> Servers
- Add the remote server to the list
- Check the box "use path mapping
- Add the absolute path of the server's web root, to the right of the web root of your local project.

After that, it worked like debugging on a local web server setup.


Please sign in to leave a comment.