New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XDebug for Drush #127
Comments
That's the configuration for debugging web sessions in the browser, but that doesn't help for debugging Drush commands, does it? |
That works for me both for drush/composer and web requests. Also try to enable "Break at the first line in PHP scripts" and execute drush command. |
Hmm, no luck with it yet.
Note, I had to change the last piece to 1, otherwise I wouldn't even get web sessions to work. My server setting in PhpStorm is this: Again, web server debugging is working but when I go into the PHP container with |
You should use Also, I'm not sure about |
OK about the PHP_IDE_CONFIG, but the first My ifconfig of the PHP container:
Yes, my OS is Ubuntu 16.04 |
yep Try to define |
Problem is, when I set 172.18.0.10 in the docker-compose.yml and restart the container, then the IP address changes, it's now 172.18.0.11 My docker-compose.yml looks like this:
The Traefik container is running on its own, because that serves multiple projects at the time. |
|
Yeah, that's it! Thanks a lot @PavelPrischepa this is now solved. Great support. |
Experiencing the exact same issue on my installation and just can't get it to work. Browser debugging works fine. Could someone please give me a complete rundown/screenshots of how phpStorm should be configured to get this to work? Getting the following error in phpStorm whenever "Listening for PHP Debug connections" is turned on & running any drush command: |
@rafatwork that's because drush is located out of codebase dir, so PhpStorm fails to map php execution to php sources. The best solution is per project drush. Add drush as dependency via composer and use it via |
@PavelPrischepa Thanks, I'll give that a go ASAP. What about Drupal 7 projects however? There's no composer involved. |
@rafatwork it seems the same issue, drush installed globally that's why its sources isn't available for PhpStorm. So in case of D7 just put drush into the codebase. |
@PavelPrischepa |
@rafatwork you should configure directory mapping in Languages & Frameworks -> PHP -> Path mappings. |
XDebug for http requests in the browser is working OK, I just wonder how I could get XDebug to also work for Drush on the console.
In PhpStorm this works quite nicely when Drush is executed on the host. What it does is to execute something like this:
Abd I can set breakpoints like always and everything is working just fine. However, if Drush is executed inside the PHP container, I don't get this to work and wonder what else I need to be doing.
Any idea?
The text was updated successfully, but these errors were encountered: