Previous PHP Debugging tools, like Zendstudio or Phpclipse,storm, are running too slow, or this works.
1, first official website download vs code address: https://code.visualstudio.com/, download directly after installation can be.
2, installation of extended Php-debug installation procedures See Https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug
Specifically: press ctl+shif+x or DOT red "extended label", enter Xdebug can be installed
3, in the menu bar: file-"Preferences-" configuration
Pop up the following window and add "Php.validate.executablePath": "D:/usr/local/php.exe"
Put the settings in this file to override the default settings
{
"Php.validate.executablePath": "D:/usr/local/php/php.exe", "
editor.fontsize": The
}
4. You must open your PHP project directory before you can set up debug
1. Click on the gear, select php--"Select Listen for Xdebug
(Configuration file content does not need to be moved)
5, open the PHP file, in the specified line press F9 set breakpoints, and then start debugging.
Test configuration is correct, you can in the cmd window, perform netstat-an to see if the machine is listening for 9000 ports.
6, access to debug Web pages
Appendix:
VS code Modify Shortcut binding: File--Preferences--keyboard shortcuts
[{
key]: "F8",
"command": "Workbench.action.debug.stepOver",
" When ":" Indebugmode "
},{"
key ":" F7 ",
" command ":" Workbench.action.debug.stepInto ",
" when ":" Indebugmode "
}
]