Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote debugging with XDebug and PHPStorm

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.

like image 508
Raffael Avatar asked Aug 29 '11 18:08

Raffael


Video Answer


3 Answers

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.

like image 191
Raffael Avatar answered Oct 18 '22 14:10

Raffael


If you are still having problems, there are two blog posts by the makers on how to set things up correctly.

First should work in most cases and requires zero-configuration other than a working xdebug install

Second details all of the configuration settings in detail

like image 38
Blair McMillan Avatar answered Oct 18 '22 15:10

Blair McMillan


To 'see' the profile.ini in the PHP Storm 'Select File' Dialog simply rightclick inside of it and choose 'Show hidden files' then (in WIn7) move to C:\Users\YOURUSERNAME\AppData\Roaming\Mozilla\Firefox or the equivalent in your OS

like image 21
b0r7 Avatar answered Oct 18 '22 14:10

b0r7