Phpstorm and xdebug breakpoints

I use phpstorm for website development, but for some reason breakpoints are not syncing. Here is my situation:

I have a folder in which I save all my projects. On the same PC, I also have xampp working as a test server. In phpstorm, I have an xampp test server configured as an installed folder server. But when I apply breakpoints in the original source files, these breakpoints are not synchronized with the files in the htdocs xampp folder. How can i solve this?

+4
source share
4 answers

It looks like you need to set up path mappings. There is information about this - http://blogs.jetbrains.com/webide/2011/03/configure-php-debugging-in-phpstorm-2-0/

+8
source

I had a similar problem when I set a breakpoint, but it did not stop at it during debugging. My web server uses a virtual drive letter to simplify the httdocs path. Therefore, my mistake was that I did not set the virtual path as the root of the project contents in the files-directories, but in the real path to my local folder

+2
source

I had a similar problem with phpstorm 4.x / xdebug 2.2.3 / php 5.4.3

I could set a breakpoint in the code, and it would work, but as I went through the lines, I saw that the debugger was not synchronizing with the actual code. This meant that some breakpoints were skipped.

After a lot of experimentation, I finally decided that the problem was caused by the fact that I had line breaks in my var.

For instance:

$q = "SELECT * FROM table WHERE product_id = 'whatever' AND product_status != 'inactive'"; 

will discard the debugger for 4-5 lines when it comes to this statement.

Change this to:

 $q = "SELECT * FROM table WHERE product_id = 'whatever' AND product_status != 'inactive'"; 

fixed problem!

Obviously, this will affect any var declaration with line breaks, and not just those intended for SQL queries. A bit of pain, because I do it for readability, but I hope it saves time for someone else with the same problem.

+2
source

This may not work for you, but I only have my MAMP home folder in the root folder of my project, so no synchronization / installation is required

0
source

All Articles