Debug php with vim in windows

Source: Internet
Author: User
Tags vc9
A cool man wrote a manual to introduce the php debugging method and the configuration methods under different ides. He tried the methods in ubuntu and tried to use vimdebug in windows, so I tried it in xp according to the ubuntu method. After several twists and turns, I finally got it done. Record: 1. Download xdebug. If you don't know which one to download, how to write it?

Some cool people wrote a manual to introduce the php debugging method and the configuration methods in different ides. They should follow the methods in ubuntu and try to use vim debug in windows, so I tried it in xp according to the ubuntu method. After several twists and turns, I finally got it done. Record: 1. Download xdebug. If you don't know which one to download, how to write it?

Some cool people wrote a manual to introduce the php debugging method and the configuration methods in different ides. They should follow the methods in ubuntu and try to use vim debug in windows, so I tried it in xp according to the ubuntu method. After several twists and turns, I finally got it done. Record it:

1Download xdebug. If you do not know which one to download, how to write the configuration and set your phpinfo ()? The output is saved here for query, downloaded to the ext directory of the php installation directory, and then stored in the php. add the configuration information of xdebug to ini (as follows: note that the remote_port must be the same as that set in debugger and is not occupied), then restart the web server, and then phpinfo () check whether the configuration is correct in the output.

[XDebug]
Zend_extension = "G:/web/php/ext/php_xdebug-2.1.4-5.3-vc9.dll"
Xdebug. remote_enable = true
Xdebug. remote_host = localhost
Xdebug. remote_port = 9000
Xdebug. remote_handler = dbgp

Note that the port is not occupied. The port occupied by php fastcgi is generally 9000. If there is a conflict, change it to another port, such as 9001, and then set it in vimrc? Let g: debuggerPort = 9001.

2Download DBGp and put debugger. vim and debugger. py in the directory of plugin under vimfiles. vim requires + python + signs, and vim73 has enabled these two options by default in windows.

3, Edit debugger. vim, and modify the path of the debugger. py file in the pyfile call.

4, Edit debugger. py, and change self. sessfile (line 441) in DebugUI to your own path. For example

Self. sessfile = "C:/Documents and Settings/zhanglin/vimfiles/session/debugger_vim_saved_session." + str (OS. getpid ())

Then, search for [7:] (3) and change it to [8:]. This is because the first character of the absolute path in linux is/, but not in windows.

5Download python (version 2.7.3, which cannot be identified by vim7.3 of 3.2.3) and put python.exe into the environment variable to ensure that vim can find python.

6Restart vim, find a php file, set the breakpoint by Bp, press F5 to start debugging, and then add the parameter ?? XDEBUG_SESSION_START = 1 to access this php file. Then, vim receives the signal and breaks down in the first line of the file. Then, you can follow up on the code execution step by step. The control shortcut keys are listed on the right.

Note: add? After the XDEBUG_SESSION_START parameter, php automatically sets? The cookie of XDEBUG_SESSION does not include this parameter in subsequent requests.

If you don't want to do it yourself, you can download my configuration file.

Some cool people wrote a manual to introduce the php debugging method and the configuration methods in different ides. They should follow the methods in ubuntu and try to use vim debug in windows, so I tried it in xp according to the ubuntu method. After several twists and turns, I finally got it done. Record: 1. Download xdebug. If you do not know which one to download and how to write the configuration, set your phpinfo ()? The output is saved here for query, downloaded to the ext directory of the php installation directory, and then stored in the php. add the configuration information of xdebug to ini (as follows: note that the remote_port must be the same as that set in debugger and is not occupied), then restart the web server, and then phpinfo () check whether the configuration is correct in the output. [XDebug] zend_extension = "G:/web/php/ext/php_xdebug-2.1.4-5.3-vc9.dll" xdebug. remote_enable = true xdebug. remote_host = localhost xdebug. remote_port = 9000... Continue reading →

Original article address: Debug php with vim in windows. Thank you for sharing it with me.

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.