VIM + xdebug debug php1. install xdebug
Sudo apt-Get install php5-xdebug
2. Configure xdebug
Edit/etc/PhP5/apache2/CONF. d/xdebug. ini and add
Xdebug. remote_enable = 1
Xdebug. remote_port = 9000
Xdebug. remote_host = localhost
3. Install the vim plug-in dbgp
Download: http://www.vim.org/scripts/script.php? Script_id = 1, 1929
Download the package and put it in the Plugins directory.
4. Open the PHP page to be debugged in the browser and add? Xdebug_session_start = 1 parameter
Open this file with vim, set the breakpoint with: bp, and then set the F5 key. VI will prompt waiting for a new connection on port 9000 for 5 seconds... In five seconds, refresh the page and you can see the debugging interface in Vim.
If attributeerror ("dbgprotocol instance has no attribute 'stop'" appears, it indicates that the configuration is successful or xdebug. remote _ * is not configured, or is it not added at the end of the URL? Xdebug_session_start = 1, or you have not refreshed the page within 5 seconds.
5. when getting the variable content, if the variable is array, only (array) will be displayed by default, instead of all elements in the array. If the array element content cannot be displayed, therefore, debugging may encounter many problems. comments in Vim are stored in. add the following line to vimrc:
Let G: debuggermaxdepth = 5
More configurations are described in debugger. vim.