Skip to content

Instantly share code, notes, and snippets.

@chrismcintosh
Last active July 12, 2022 00:22
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 chrismcintosh/b8d295297da56f17420cac89fee23989 to your computer and use it in GitHub Desktop.
Save chrismcintosh/b8d295297da56f17420cac89fee23989 to your computer and use it in GitHub Desktop.
Homestead 2022 - X Debug 3 - PHP 8 working (July 11, 2022) config
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.discover_client_host=1
xdebug.client_port = 9003
xdebug.max_nesting_level = 512
xdebug.idekey=VSCODE
xdebug.client_host=10.0.2.2
xdebug.start_with_request=yes
@chrismcintosh
Copy link
Author

chrismcintosh commented Jul 12, 2022

  1. Add phpinfo(); to a route to see where your xdebug file lives
  2. Edit that file using sudo vim [location of file] while ssh'd into homestead
  3. Save the configuration and restart that version of php from the command line sudo service php8.0-fpm reload
  4. Add the following configuration to VS Code as a json file in your project at .vscode/launch.json

{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", "pathMappings": { "/home/vagrant/sample": "${workspaceFolder}" }, "port": 9003 } ] }

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