drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.

Home Page:https://www.drush.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enabling Xdebug causes drush to hang on subcommand

bradjones1 opened this issue · comments

Steps to reproduce:

Using an IDE (PhpStorm), enable the Xdebug listener but do not set a breakpoint.
In your development environment (I'm using Drupal 8), already established to work on a single Drush request throwing breakpoints (e.g., early in drush.php), run a command that spawns a subcommand, e.g., drush updb.

Drush will hang after "No database updates required," while it is running a cache-rebuild. PhpStorm does not stop at any breakpoints.

Turn off the IDE's Xdebug listener and the command will complete as expected.

Or, remove the XDEBUG_CONFIG variable from the environment and drush will complete as expected (since Xdebug is effectively turned off.)

The only possibly-related issue I can find on something like this is #1378, but that seems rather different.

Increase the number max simultaneous connections in PHPStorm Prefs (Search for Debug in prefs search bar).

Thanks!

I just came across this too but it took me a while to figure out, thanks for confirming this needs to be bumped up.

Without meaning to necro this thread, thought I'd drop in something else that I learned while trying to get drush to play nicely with Xdebug while the listener was enabled in PHPStorm.

Increasing the number of simultaneous connections did not solve this for me (although I've left them increased for now). What did it for me was disabling both Force break at first line when on path mapping specified and Force break at first line when a script is outside the project from the Xdebug section of the Debug config.

Hope this helps someone.