Skip to content

Instantly share code, notes, and snippets.

@madebycaliper
Last active September 11, 2021 23:03
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 madebycaliper/59c0ff62509b6974c286797823ef4b16 to your computer and use it in GitHub Desktop.
Save madebycaliper/59c0ff62509b6974c286797823ef4b16 to your computer and use it in GitHub Desktop.
Laravel + VScode + xdebug 3.x + setup on Mac

Add a configuration to the debug panel in VSCode

// launch.json
{

  "version": "0.2.0",
  "configurations": [
    {
      "name": "Laravel XDebug",
      "type": "php",
      "request": "launch",
      "port": 9003  // make sure to with client_port above
    }
  ]
}

Set the correct path to php >8.x in the vscode-phpunit settings

(figure out which version of php >8.x you're runninig in shell via which php)

In VScode settings search "@ext:recca0120.vscode-phpunit" and update Php to:

/usr/local/Cellar/php/8.0.7/bin/php

or edit directly in the settings.json file

"phpunit.php": "/usr/local/Cellar/php/8.0.7/bin/php"
// located at:
// /usr/local/etc/php/8.0/php.ini
// Find php.ini location by running:
// php -i | grep .ini
zend_extension=xdebug.so
xdebug.mode = debug
xdebug.discover_client_host = true
xdebug.client_port = 9003
xdebug.max_nesting_level = 512
xdebug.start_with_request = yes
xdebug.ideKey = VSCODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment