Debugging a PHP configuration with vs code editing

Source: Internet
Author: User

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 "
}
]


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.