Skip to content

Instantly share code, notes, and snippets.

@raphaellarrinaga
Last active February 17, 2018 10:31
Show Gist options
  • Save raphaellarrinaga/c8c09de0c89e9370bdd6c31562bca598 to your computer and use it in GitHub Desktop.
Save raphaellarrinaga/c8c09de0c89e9370bdd6c31562bca598 to your computer and use it in GitHub Desktop.
Some option to configure xdebug with sublime, drupalvm

Some option to configure xdebug with sublime, drupalvm

IDE is listening for connections

Install Sublime text client https://github.com/martomo/SublimeTextXdebug

Your browser extension is set to debug

Install chrome xdebug helper https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc

For working in Drupal 8, you will need to add this line to the xdebug section of your php configuration,

either in xdebug.ini or php.ini, if you are using a version of xdebug prior to 2.3:

xdebug.max_nesting_level=1000

Use drupal module twig xdebug

https://www.drupal.org/project/twig_xdebug

In drupalvm config.yml, Enable xdebug via installed_extras and set the following as well:

php_xdebug_idekey: sublime.xdebug php_xdebug_default_enable: 1

Edit your project's .sublime-project file (Project menu > Edit project) and add the following sibling to

the "folders" config that should already exist:

"settings": { "xdebug": { "path_mapping": { "/var/www/projectname/docroot" : "/Users/jeff.geerling/Sites/projectname/docroot", }, "url": "http://local.projectname.com/", "super_globals": true, "close_on_stop": true } }

Run

Set a breakpoint in the twig template with {{ devel_breakpoint() }}

Ressources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment