Skip to main content
3 of 7
added 224 characters in body
albertski
  • 3.5k
  • 4
  • 25
  • 48

Can't get drush script to stop at breakpoint with Xdebug/Phpstorm

I had this working on another Drupal VM but for some reason I can't get it to work anymore. I am trying to debug a drush migration script and I have some breakpoints put in but it never stops at the breakpoints. I followed steps shown here.

Here is my xdebug section of config.yml from vagrant:

# XDebug configuration. XDebug is disabled by default for better performance.
php_xdebug_default_enable: 1
php_xdebug_coverage_enable: 1
php_xdebug_cli_enable: 1
php_xdebug_remote_enable: 1
php_xdebug_remote_connect_back: 1
php_xdebug_remote_host: xxx.xxx.xx.xx // My Vagrant IP is really here.
# Use PHPSTORM for PHPStorm, sublime.xdebug for Sublime Text.
php_xdebug_idekey: PHPSTORM
php_xdebug_max_nesting_level: 256

The web server debug validation shows everything is good. I also verified that if I debug on a page that I visit from a browser it does stop at breaks points so it is for sure working.

Also, the PHP CLI does have Xdebug:

PHP 7.0.14-2+deb.sury.org~xenial+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.14-2+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans

One thing I noticed is that if I set Phpstore to break at first line in PHP Script, I noticed the following notice in debugger: Can't compute source position. The script 'drush.phar' isn't associated with any text file type.

Any ideas what I can try to get it to work?

albertski
  • 3.5k
  • 4
  • 25
  • 48