Setup XDebug in VSCode
Home » BLOG » Debug » Setup XDebug in VSCode

Setup XDebug in VSCode

category:  Debug, VSCode

Visual Studio Code version 1.19.3

Recently I change my developing tool from NetBeans to VScode(Visual Studio Code). The main reason is, VScode is faster. Plus I can integrate the XDebug extension to VScode easily.

set XDebug in VScode

  1. Create a test.php in your webroot and add phpinfo();  command into the test.php
  2. Go to your browser (Chrome, Firefox, IE, Safari, etc) then type http://localhost/test.php.
  3. After that, copies all text on a screen and pastes into xdebug wizard website.
  4. Next, just follow the xdebug wizard instruction that you see on the xdebug wizard website.
  5. Install PHP Debug extension by Felix Becker then reload VScode
  6. Next, at VScode, open your project
  7. Then go to the debugger icon(bug icon on the left side) and hit the little gear icon.
  8. Choose PHP for debug
  9. A new launch configuration will be created with listen for xdebug and launch currently open script.
  10. Now you are able to use Xdebug with PHP project.