1. Download and install vscode
What you downloaded is a compressed package and unzip it to a directory.
2. Install the debugging plug-in in vscode
Click on the extension in the right column, enter xdebug, and when php debug comes out, click Install.
In the menu bar: File->Preferences->Configuration, add a new line of configuration on the right:
“php.validate.executablePath”: “D:/xampp/php/php.exe”
3. Verify whether the configuration is successful
Create a new folder php, and create a new test.php file in the folder.
Note that you must open a folder to successfully set breakpoint debugging. A single file is invalid.
Set a breakpoint and start debugging. Click the gear, select php->select listen for xdebug (the configuration file content does not need to be changed)
In the cmd window, execute netstat -an
to see if the machine is listening on port 9000.
Recommended tutorial: vscode tutorial
The above is the detailed content of vscode configure php development environment. For more information, please follow other related articles on the PHP Chinese website!