Debug problems

I have started using PhpStorm to develop a Drupal module. I had debug working well till a few days ago when I recieved a message "Debug session was finished without being paused" I clicked on break at first line and after that it started breaking at the index page first line. This is annoying so I tried to stop it via Run|stop at first line however this did not work, the tick disappeared but it still stopped at the index page. I did a search to see if I could fix this and I found a post suggesting turning it of at Settings | Languages & Frameworks | PHP | Debug
so I turned it of there which stopped the break at index. However I had problems with stopping at breakpoints so I set it back again.
Now I am completley lost it stops at index but wont stop on my breakpoints.
How do I fix this?

2 comments
Comment actions Permalink

I seem to recall something similar and I think the way I resolved it was to increase the maximum number of simultaneous connections under:

Settings > Languages & Frameworks > PHP > Debug > "Max. simultaneous connections"

I think I set it to 6 (established by checking the ports used on the web server). Not knowing much about your setup, i.e. are you on Windows, are you developing remotely, are you using xDebug or Zend Debugger, I'm not sure if this will help you or not. I had PHPStorm installed on a windows machine with a remote web server on Linux (Ubuntu) and using xDebug.

Other things you could consider are:
1. Is the file that you have a breakpoint on the same file that is executed on the web server? For example, developing with something like Symfony (which I believe Drupal is built on) there are a lot of cached files that are executed and the main file is not therefore the debugger will not report the file you are waiting to break on. With symfony I can run it in development mode and I think I also needed to tell doctrine not to use proxy objects so that it would break on the file I was expecting.
2. Check your mappings are correct: https://www.jetbrains.com/phpstorm/help/override-server-path-mappings-dialog.html. If your mappings are incorrect PHPStorm won't match the files reported by xdebug correctly (again I think relevant for remote development).

Sorry there are a lot of "I thinks" but that seems to be the way with debugging and my experience. You can lose days hunting these things. Hope one of these helps.

0
Comment actions Permalink

Hi there,

Such behaviour usually means (based on my experience) that:

  • there is something wrong with path mappings
  • or script which you are trying to debug is outside the project (and therefore no path mappings can be applied)
  • or no breakpoints were properly set.


Need more info to say anything more: OS, PHP & xdebug versions, your setup, what did you upgrade recently

P.S.
I suggest to create brand new empty project, create very simple script there (1 instruction per line) and try to debug it -- it may give some hints where the issue may be.

----

0

Please sign in to leave a comment.