Vim配置PHP可视化调试
vim吧
全部回复
仅看楼主
level 11
hejiannn 楼主
本文主要针对Ubuntu里通过Vim进行PHP可视化调试,其他Linux发行版应该大同小异。
首先要在Ubuntu里
配置好Vim和Vdebug插件,参考这里: https://tieba.baidu.com/p/3626543542
然后需要
配置好xdebug:
$ sudo gvim /etc/php5/apache2/conf.d/20-xdebug.ini
添加以下设置:
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
然后可以开始调试PHP代码了,
调试方法为:
在浏览器的URL地址后面添加?XDEBUG_SESSION_START=1,例如:
http://localhost/index.php?XDEBUG_SESSION_START=1
在Vim里打开要调试的PHP文件,按F5,然后在规定的时间内刷新浏览器里的页面,就进入调试状态了。
Vdebug快捷键:
F5: start/run
F2: setp over
F3: step into
F4: step out
F6: stop debugging
F9: run to cursor
f10: toggle line breakpoint
2015年03月10日 06点03分 1
level 14
我顶[吼叫]
2015年03月10日 07点03分 2
level 6
请帮助乌干达可怜孩童。
2015年03月10日 09点03分 3
1