Remote debugging and mapping issues

Hello community!
While considering to move from PHPEd to PHPStorm, we have run into some issues with php-debugging which I hope someone can help shed some light on.

We are remote debugging on CentOS 7 servers running PHP 5.4, Apache 2 and x-debug.

1. Project root mapping.
As our Apache document root is above the project root in the project structure (see below), we had a hard time figuring out how to map things correctly. We ended up doing it like this:
/some/dirs/on/client/projectRoot/src/site/DocRoot/ => /some/other/dirs/on/server/projectRoot/src/site/DocRoot/
/some/dirs/on/client/projectRoot/                  => /some/other/dirs/on/server/projectRoot/

We did not state any web path for the project root, which caused a warning, but the setup above was the only one, which would pass validation. We do however still experience trouble when the debugger is trying to map individual files between server and client.

Question: is there another (correct) way of mapping this when the document root is != the project root?
(I am partial to believe that this problem may be the cause of many of the other issues we are experiencing).

2. Debugger does usually not stop on breakpoints / xdebug-break();
Often (mostly) the debugger will not stop on set breakpoints. Only "break at first line in php scripts" seems to work consistently. This applies to scripts started by http-requests, when running scripts from PHPStorm things seem to work consistently OK.

Question: is this to be expected or will a correct setup make debugging (remote breakpoints etc) work consistently?

3. PHPStorm is one line off when single-stepping through code
In some of the scripts PHPstorm will be one line off (below) the line where it should be, causing a lot of confusion. I have theorized this to be related with trailing line breaks on include() but as of writing this have not been able to confirm this.

Question: is it a known bug that PHPstorm is off one or more lines when stepping through code?

4. Is it not possible to jump to another line within the code when debugging?

Question: PHPEd allows you to select the next line to execute when single-stepping through code (within limits related to scope). Is this not possible to do with PHPStorm/x-debug?

Question: Which debugger is better? x-debug og Zend's debugger, or is this a matter of opinion?

Thanks in advance for any advice!

1 comment
Comment actions Permalink

1/2/3. You need to setup the mapping here: File | Settings (Preferences for Mac OS) ->

4. Run -> "Force run to cursor option" is suitable for your needs.
XDebug has more possibilities than Zend debugger, but generally it's the matter of opinion.


Please sign in to leave a comment.