I. Documents required
1.XAMPP Integration Server (personal use 7.1.7) https://www.apachefriends.org/download.html
2.vscode https://code.visualstudio.com/
3.x-debug (depending on the version of PHP installed, the individual uses PHP 7.1 VC14 TS) https://xdebug.org/download.php
4.vscode Plug-in
Second, the configuration process
1. Install XAMPP to computer, add PHP folder path in environment variable-system variable-path (entire PHP folder instead of Php.exe)
Enter php-v in cmd to check if configuration is successful
2. Copy the downloaded X-debug file (php_xdebug-2.5.1-7.1-vc14.dll) to the Php\ext folder
PS. If you are prompted to "computer lost Php7.dll" When you start Apache in the XAMPP panel, check to see if the downloaded X-debug file name contains nts if you try to change it to another version.
3. Open the php.ini in the PHP directory and add the following lines at the end of the configuration
[Xdebug]
Zend_extension= "E:/program/xampp/php/ext/php_xdebug-2.5.1-7.1-vc14.dll" (change path by itself)
xdebug.remote_enable = 1
Xdebug.remote_autostart = 1
4. Install Vscode, search for PHP debug in the expansion store inside, click Install
5. Click on the Vscode file-preferences-settings (different versions may show different, note look for user settings), add a line of configuration
"Php.validate.executablePath": "E:/program/xampp/php/php.exe",
6. Configure Debug
Jump out of the Launch.json default can
7. Start debugging
8. Open the PHP you want to debug in the browser (not the file path but the address of the server (http://127.0.0.1/test/test.php)), Vscode will hit the point where the break
Finally, 2 Vscode plugins are recommended:
The PHP IntelliSense plugin supports function definition jumps. The PHP7 ext address must be added to the computer's environment variable, Path.
PHP intellisense-crane code hint completion.
Xampp+vscode Development of PHP configuration flow