Vim+xdebug Debugging PHP
1. Install xdebug
sudo apt-get install php5-xdebug
2. Configure Xdebug
Edit/etc/php5/apache2/conf.d/ Xdebug.ini, join
xdebug.remote_enable = 1
Xdebug.remote_port = 9000
Xdebug.remote_host = localhost
3 Install the vim plugin dbgp
Download page: http://www.vim.org/scripts/script.php?script_id=1929
and put it in the plugins directory after download.
4. Open the PHP page you want to debug in the browser and add it after the URL? Xdebug_session_start=1 parameter
Use VIM to open this file, with: Bp set breakpoints, and then the F5 key, VI will prompt waiting for a new connection on port 9000 for 5 seconds ... , this time in 5 seconds to refresh the page just now, you can see the debugging interface in Vim.
If it appears, Attributeerror ("Dbgprotocol instance has no attribute ' stop ', then no configuration is successful, either xdebug.remote_* is not configured, or the URL Not joined at the tail? Xdebug_session_start=1, either you didn't refresh the page within 5 seconds.
5. When you get the contents of a variable, if the variable is an array, then the default will only show (array), instead of displaying the elements within the array, if the contents of the array elements cannot be displayed, then debugging will encounter a lot of problems, so you can according to the comments in the Debugger.vim, self- Add the following line to the. VIMRC:
Let g:debuggermaxdepth = 5
More configurations, which can be followed and so on, are described in Debugger.vim.
Go from http://lds2008.blogbus.com/logs/115127244.html