Skip to content

Instantly share code, notes, and snippets.

@robdecker
Last active May 6, 2020 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robdecker/54e428e0219e69ca0238c00fbcdbd7d1 to your computer and use it in GitHub Desktop.
Save robdecker/54e428e0219e69ca0238c00fbcdbd7d1 to your computer and use it in GitHub Desktop.
[Drupal, PhpStorm/VSCode, Lando, xDebug] #d8

VSCode

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Listen for XDebug",
      "type": "php",
      "request": "launch",
      "port": 9002,
      "pathMappings": {
        "/app/": "${workspaceFolder}/www/",
      }
    }
  ]
}

Turn xDebug on/off

nginx

tooling:
  xdebug-on:
    service: appserver
    description: Enable xdebug for nginx.
    cmd: docker-php-ext-enable xdebug && pkill -o -USR2 php-fpm
    user: root
  xdebug-off:
    service: appserver
    description: Disable xdebug for nginx.
    cmd: rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && pkill -o -USR2 php-fpm
    user: root

apache

tooling:
  xdebug-on:
    service: appserver
    description: Enable xdebug for apache.
    cmd: "docker-php-ext-enable xdebug && /etc/init.d/apache2 reload"
    user: root
  xdebug-off:
    service: appserver
    description: Disable xdebug for apache.
    cmd: "rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload"
    user: root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment