Looking for a tutorial on remote debugging with version 5, samba, win <> linux combination

Hi folks,

I am trying to get remote debugging up and running. Yet I failed.
In short: I was wondering if there is any /recent/ step-by-step tutorial around with my setup: a windows and linux box connected via Samba using PHPSTORM 5.

My setup
- PHPStorm 5 is installed on my windows 7 machine
- the webserver testdomain.dev is running on my ubuntu 12.04 box (both machines are in my local network)
- The project directory with the sources is mapped via samba on Z:/
- xdebug is installed and working
- the bookmarklets are installed and I started a debug session

I also added testdomain.dev as a server in the project settings and mapped the paths

Yet it does not work, PHPStorm does not interact with xdebug

Thanx
Dorthe

6 comments
Comment actions Permalink

Hi there,

This may answer your question (in case you have not seen this article yet and/or were doing it differently): http://confluence.jetbrains.net/display/WI/Zero-Configuration+debugging+with+PhpStorm+2.0

I suggest trying it on brand new project with very basic and simple script (few lines, something along $a = 1; $b = 4; $z = $a + $b; echo $z; -- one statement per line) -- this will allow to make sure that the actual debugging works and that it is not something different (e.g. further configuration is required).

Other possibly useful links:

0
Comment actions Permalink

Hi,

I was stuck in this tutorial at the point "Switch to PhpStorm and set the initial path mappings by selecting the path to the local copy of the script that we are debugging. These paths are similar if you are editing files directly on the server."

Where do I set the initial path mapping in PHPStorm5? Is it the same like settings -> php -> servers -> add server -> use path mappings?

Let's say my source code is available via samba share at

z:\testdomain.dev\htdocs\app

The local copy PHPStorm made is here:

c:\users\foo\hpstorm\app\

The path on the unix machine is

/vol/www/testdomain.dev/htdocs/app/

Is the correct mapping then:
File/Directory: c:\users\foo\hpstorm\app\
Absolute Path on the Server: /vol/www/testdomain.dev/htdocs/app/

Thanx
Dorthe

0
Comment actions Permalink

Hi there,

Where do I set the initial path mapping in PHPStorm5? Is it the same like settings -> php -> servers -> add server -> use path mappings?

Yes.

Is the correct mapping then:
File/Directory: c:\users\foo\hpstorm\app\
Absolute Path on the Server: /vol/www/testdomain.dev/htdocs/app/

Looks fine to me (as long as paths are correct). Keep in mind that xdebug will resolve all symbolic links, so if you have them in your project, then use full real path instead.

But what I would suggest instead -- delete any changes you have made in Settings | PHP | Servers -- when you do as described in that article (zero configuration one), when PhpStorm receives incoming xdebug connection and no mappings defined, it will pop special window and will offer to set such mapping up in convenient way (in most cases (at lest in my practice) it suggests correct mapping choice straight away).

Question: are you sure that xdebug is configured properly (as this is the most often reason for "my remore debug does not work" posts)? Can you post your xdebug settings (from your php.ini  ... or whatever file is used in your Linux distrib).

0
Comment actions Permalink

Good shot, Andriy,

I wasn't aware that I have to enable remote debugging in the php.ini

- I started with a tiny simple hello world project as suggested
- I enabled remote debugging in xdebug (as far as I can see)
- I restarted the webserver
- I checked the xdebug settings in php info

Nevertheless, the mentioned "configure dialog" in PHPStorm does not pop up for me.

Please find my php.ini attached. And yes, I need this ancient php version (5.2) in this project.

I am using apache2 with fastcgi to manage multiple php versions in parallel at the server, is this a problem?

Thanx
Dorthe



Attachment(s):
php.ini.tar.gz
0
Comment actions Permalink
xdebug.remote_port=10000

Make sure that the port number in PhpStorm (Settings | PHP | Debug | Xdebug ) matches the one you have (default port numebr is 9000 while you have set it to be 10000).

screen01.png

xdebug.remote_host="127.0.0.1"


This is wrong. It should be IP of the computer where PhpStorm is running. It should be the IP that Linux machine sees when comunicating with your Windows PC (the easiest way will be to check $_SERVER['REMOTE_ADDR'] or similar).

P.S.
Obviously, make sure that Phpstorm is allowed to accept incoming connections on xdebug port in your firewall (make it trusted or whatever).



BTW -- this makes not much sense (to have both of them turned on by default):

xdebug.profiler_enable = On
xdebug.remote_enable=On

Profiler is for measuring execution time and finding what methods were executed most times and how long it took (to find bootlenecks in your code and how your app can be optimised). While debugging, the delays are expected and are natural (when you step into function, see variable values etc etc), therefore profiling in such moment is completely useless. Better to trigger it when required (using bookmarklet or custom browser extension). Generally speaking you will have only 3 states: debugger and profiler are off; debugger is on, profiler is on. So in regards of profiler, this should be better approach (at least in my eyes):

xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 1
0
Comment actions Permalink

Andriy, you're a genius!!

It works! Thanx a lot! :-)

0

Please sign in to leave a comment.