PHPStorm / debugger not stopping at certain breakpoints

magento, phpstorm, xdebug, zend-framework

Solution

This almost has to be the result of mismapped paths in phpstorm. You can configure paths in Settings->PHP->Servers. I ran into a similar problem and all I had to do was to set the correct absolute path on the server (where xdebug is running) in the mapping for the root of my code in phpstorm. e.g. `c:\my\code\lives\here\on\my\dev\box` => `/myserver/my/code/lives/here/on/my/actual/server`.

Here is a more complete solution, and some tips on debugging XDebug in general:

Add a remote log file to your xdebug settings: `xdebug.remote_log = /path/to/logs/xdebug.log`

Restart apache

Tail the log (I'm assuming you can do this in OSX) `tail -f /path/to/logs/xdebug.log`

--You might see something obviously wrong by keeping track of the log contents the next time you try to debug a page. If so, just do whatever you need to do. If not, let's still assume it's a mismapping of paths and continue to try to fix that:--

Set a breakpoint where you know PHPStorm/XDebug will actually stop and make it stop there. In a lot of places on the web people report index.php being the easiest place to make PHPStorm actually stop at a breakpoint for the first time.

In a file that you can't get PHPStorm/XDebug to stop in, set and unset a breakpoint while PHPStorm is stopped at the breakpoint in the index.php file. You should see lines in your xdebug log file that look like this:

<- breakpoint_set -i 19 -t line -f file:///myserver/my/code/lives/here/on/my/actual/server/file.php -n 159 ->

- See if the file actually does live where XDebug is looking for it e.g.

`tail /myserver/my/code/lives/here/on/my/actual/server/file.php`

- If the file doesn't actually live there, adjust the path mappings in your PHPStorm settings until PHPStorm is telling XDebug to look at files that actually exist. e.g. if XDebug had said `file=/mysrver/my/code/lives/here/on/my/actual/server/file.php`, then in step 6 you would have noticed the file didn't exist on the server, and then you might realize "oh oops I spelled myserver wrong in the path mapping", and fixing the spelling in PHPStorm would then probably fix the issue.

This is a bit of an old thread but hopefully this will help someone eventually :)

Problem

I've set up XDebug (2.2.1) and PHPStorm-IDE (Mac OS X 10.7.5) with standard LAMP stack for Mac OS (Apache 2.2.22, PHP 5.3.15). /etc/php.ini ``` [xdebug] zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so xdebug.file_link_format="txmt://open?url=file://%f&line=%1" xdebug.remote_enable = On xdebug.remote_autostart = "PHPSTORM" xdebug.var_display_max_data = 1024 xdebug.dump.GET=* xdebug.dump.POST=* xdebug.show_local_vars=On xdebug.dump.SERVER=* xdebug.dump_globals=On xdebug.collect_params=4 ``` I followed these two tutorials and it works in 99% of my project files: - http://blog.jetbrains.com/webide/2011/03/configure-php-debugging-in-phpstorm-2-0/ - http://blog.jetbrains.com/webide/2011/02/zero-configuration-debugging-with-xdebug-and-phpstorm-2-0/ I use Zend Frameworks MVC architecture. I am able to stop at breakpoints in most of my controller classes, but in some other controllers PHPStorm ignores all of my breakpoints. Do you have any suggestions? How can I debug the debugger? What kind of configuration error could cause that? Thanks for your help.

Original source