Remote debugging with XDebug and PHPStorm

Raffael picture Raffael · Aug 29, 2011 · Viewed 41.9k times · Source

First things first:

  • Server is an Apache running on Debian in a VMPlayer
  • Host is Windows 7
  • Debugging-Server is XDebug
  • Files are directly accessible via a shared folder

Important: XDebug is properly configured on Apache and my Win7 firewall as well. I know that b/c I can debug using Eclipse.

So what I am failing at seems to be the basic configuration of PHPStorm.

Let me give you some more details:

  • IP of Server: 192.168.56.128
  • IP of my host: 192.168.56.1

the file that I want to debug is index.php:

  • location on my Win7 host: C:\dev\sf\Symfony\
  • location on Debian: \mnt\hgfs\sf\Symfony\
  • URL: 192.168.56.128/Symfony/index.php

No matter what I fiddle together ... I get weired error messages like "Waiting for connection from JetBrains PhpStorm..." or PHPStorm asks me for Mozillas profile.ini, even though I configured Chrome as Default in Web Browsers.

So I will just set up a new project and hopefully someone tells me what is wrong with my configuration.

Run / Edit configurations / Defaults / PHP Remote Debugging:

  • Server: "Debian"
  • IDE key: -
  • Break at first line: yes

Servers:

  • Name: "Debian"
  • Host: 192.168.56.128
  • Port: 80
  • Debugger: Xdebug
  • use path mappings: yes
  • one path mapping configured:

C:\dev\sf\Symfony => /mnt/hgfs/sf/Symfony (also tried /Symfony - b/c PHPStorm shouldn't care about anything above /Symfony !?)

Run / Edit configurations / Defaults / PHP Web Application:

  • Server: "Debian"
  • Start URL: /Symfony
  • Browser: Chrome
  • Break on first line: yes

Now I choose: Run / Debug ... / 1.index.php

And I get asked for: Mozilla's profile.ini ... but I can't find it

Where is it ... ?

I already got so far that PHPStorm started Chrome. But maybe I first sort this out. So how can I get Firefox up and running? I also use Firefox with Eclipse ... no questions asked for a profile.ini.

Answer

Raffael picture Raffael · Sep 13, 2011

Okay, there are three things I'd like to share with you. It's not the full recipe but the key ingredients that were first confusing me are:

  1. The important sections to configure are "Servers" and "PHP Remote Debugging".

  2. To configure "PHP Remote Debugging" you have to first add a new dataset using the [+] in the top left corner. The panel you get from just clicking on the "PHP R D"-button just keeps the default settings!

  3. Absolute path regarding the VM actually means the absolute path starting from root (\mnt\hgfs\sf\Symfony). This was confusing to me cause I am still not sure why PhpStorm cares about directory levels above the shared folder. but it does.