How to Configure XDebug with Lando in IntelliJ or PHPStorm.

Thanks to Drupal Easy for providing the following page, which helped a lot: https://www.drupaleasy.com/blogs/ultimike/2018/01/setting-xdebug-lando-and-phpstorm

Steps

Update your lando.yml to include XDebug:

 

config:
  xdebug: true
​

Update IntelliJ / PHPStorm preferences

Preferences -> Languages & Frameworks -> PHP

  • Add an include path: /Users/brooke/.lando/config/drupal9

Set a breakpoint in index.php.

Click the "Start Listening for PHP Debug Connections" button.

Visit your site, set the XDebug browser plugin to Debug, and refresh a page.

A popup will show in IntelliJ/PHPStorm, "Incoming Connection From Xdebug"; click Accept.

Notes

I used to have to do a lot more to get this working. If something doesn't work, perhaps try the Drupal Easy page and see if that works better for you.

External References

Article Type

General