zoukankan      html  css  js  c++  java
  • VIM配置DBGp调试PHP程序

    1.安装Xdebug
    sudo apt-get install php5-xdebug

    2.配置Xdebug
    编辑/etc/php5/apache2/conf.d/xdebug.ini,加入
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.remote_host = localhost

    3.安装vim插件DBGp
    下载页面: http://www.vim.org/scripts/script.php?script_id=1929
    下载后放入plugins目录中即可。

    4.在浏览器中打开要调试的php页面,在URL后加上?XDEBUG_SESSION_START=1参数
    用vim打开此文件,用:Bp 设置断点,然后安 F5 键,vi会提示 waiting for a new connection on port 9000 for 5 seconds… ,此时在5秒内刷新刚才那个页面,即可在vim中看到调试界面。

    如果出现 , AttributeError("DbgProtocol instance has no attribute 'stop'", 则说明没有配置成功,要么是 xdebug.remote_* 没有配置好,要么是url尾部上没有加入 ?XDEBUG_SESSION_START=1 ,要么是你没有在5秒内刷新页面 .

    5.在获取变量内容时,如果变量为 array ,那么默认只会显出 (array) ,而不会显示数组内的各元素,如果无法显示数组元素内容,那么调试会遇到很多问题,因此可以根据 debugger.vim 中的注释,自行在 .vimrc 中加上如下一行:

    let g:debuggerMaxDepth = 5
    更多的配置,可以依次类推,都在debugger.vim中有所说明。
  • 相关阅读:
    Ubuntu 16.04中VirtualBox 5.1使用U盘/USB设备的方法
    VirtualBox中的虚拟机在Ubuntu 下无法启动之问题解决
    XX-net 部署网络
    Ubuntu 16.04安装Git及GUI客户端
    Ubuntu dns
    rapidjson
    ubuntu14.04 安装 搜狗输入法
    Ubuntu中解决机箱前置耳机没声音
    C++调试帮助
    ubuntu16.04安装virtualbox
  • 原文地址:https://www.cnblogs.com/gbyukg/p/2890610.html
Copyright © 2011-2022 走看看