1. Download Vscode (Visual Studio Code).
2. Install Vscode extension Php-debug installation steps See Https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug.
3. Install the Wampserver, I installed the 2.5 version, the installation steps Baidu itself.
4. Make sure Apache 80 port is not occupied if the port number under Modify httpd.conf configuration file is occupied
5. Modify PHP.ini (Wamp\bin\apache\apache2.4.9\bin this folder) file to open Debug,
Modify the following two items:
Xdebug.remote_enable = On
Xdebug.remote_autostart=on
Note: If the Phpstudy is modified as follows:
in PHP. INI Configure the address of your current directory at the bottom [Xdebug]xdebug. profiler_output_dir= "E:\phpStudy\PHPTutorial\tmp\xdebug"XDebug . trace_output_dir= "E:\phpStudy\PHPTutorial\tmp\xdebug"xdebug. remote_enable = onxdebug. remote_autostart= onzend_extension= "E:\phpStudy\PHPTutorial\php\php-5.5.38\ext\php_xdebug.dll"
6. If Vscode reported this
Modify User Configuration
7. Configure Debug
Select Listen for Xdebug
8. Start Wampserver
9. Place a breakpoint at the desired location F5 start, enter the address in the browser, Vscode automatically stops at the breakpoint
Use vs code to write PHP and debug