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. Here I will share with you how easy to set XDebug in VScode.
- Create a test.php in your web root and add phpinfo(); to the test.php
- Go to your browser (Chrome, Firefox, IE, Safari, etc) then visits http://localhost/test.php. After that, copies all text on a screen and pastes into xdebug wizard. After that, just follow the xdebug wizard instruction.
- Install PHP Debug extension by Felix Becker then reload VScode
- Next, at VScode, in your project, go to the debugger icon(bug icon on the left side) and hit the little gear icon. Then choose PHP. A new launch configuration will be created with listen for xdebug and launch currently open script.
- Now you are able to use Xdebug with PHP project.