Sublime3 + chrome + xdebug Debug PHP code

Source: Internet
Author: User

Because Phpstrom too much memory, plus the company machine too antique, so abandoned the phpstromide, instead of using Sublime3 this lightweight editor. Lightweight structure plus graceful Plug-in Pack management package Controll creates a lightweight and graceful sublime3ide, and of course Sublime's debug function is not as powerful as Phpstrom and Zend studio, but it's enough for Me. Because most of the online information is not complete, integration of this debugging environment, it cost me a lot of time, but the result is good, finally can use. Happy. Let's talk about the main integration process:


1. Open the PHP xdebug extension and edit the Php.ini:
Zend_extension = "D:\xampphp\xamphp\php\ext\php_xdebug.dll"="dbgp"= "127.0.0.1"  = 10000 #默认填写9000, if port conflict, please fill in the port other than 9000, such as 10000
  2. Installing the sublime xdebug client plugin 1) Ctrl + SHIFT + P or prefenrences-->package control to open the plugin management console 2) Enter the install package, enter, and then input xdebug client, enter   3. Install chrome plugin: Xdebug Helper (will not install please baidu). Click on the top right corner of the Chrome browser and the beetle configuration IDE key is Other:sublime.debug. Configure the Xdebug plugin to display under localhost or a specified domain name (the beetle in the top right corner of Chrome)

4. In sublime, Select Tools-----xdebug-----settting User

5. Select Project-----save Project As-----as a File. After saving, open the file to See: (it does not matter if it is not the same as the following, because folder is automatically generated when debugging Xdebug Breakpoints.) The first configuration xdebug is not a folder)

{ "folders": [{ "path": "d:\\project" }], "settings": { "xdebug" c4>: {  true, ' path_mapping ': {}, ' Port ': 10000,  t Rue, "url": "" }}}

All you have to do is to modify the port (if the ports Conflict)


6. Restart the sublime, restart Nginx or apache, and restart the chrome Browser.

7. Open any php file under localhost (because you have just configured localhost in the Chrome plugin) and turn on the Beetle green in the upper right corner to Debug.

Right-click Xdebug-----add/remove Breakpoint. (add Breakpoint)

Select Tools-----xdebug------start Debugging

Enter this PHP address in Chrome and start debugging Breakpoints.

You can see that the sublime stops at the breakpoint and shows all current variables, constants, and so On.

in chrome enter this PHP address, breakpoint debugging Begins. You can see that the sublime stops at the breakpoint and shows all current variables, constants, and so On.
Frequently used shortcut key tip:
Shift+f8: Open the Debug panel

F8: Open the Debug panel quick Connect

Ctrl+f8: Toggle Breakpoint

Ctrl+shift+f5: run to the next breakpoint

Ctrl+shift+f6: Single Step

Ctrl+shift+f7: Step Into

Ctrl+shift+f8: Step Out

Sublime3 + chrome + xdebug Debug PHP code

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.