php vagrant vim xdebug配置

来源:互联网 发布:单片机型号怎么看 编辑:程序博客网 时间:2024/06/07 01:37
一、安装xdebug


1、编译安装xdebug,也可以使用pecl install xdebug

 wget http://xdebug.org/files/xdebug-2.3.2.tgztar -zxvf  xdebug-2.3.2.tgzcd  xdebug-2.3.2phpize./configure --enable-xdebug --with-php-config=/data/php/bin/php-configmake && make install


php-config的路径一定要是你PHP-config的路径


2.填下下面东东进入你的 php.ini

zend_extension=/alidata/server/php/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so;Remote settings xdebug.remote_autostart=on xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=192.168.61.162 xdebug.remote_port=9000; General xdebug.auto_trace=off xdebug.collect_includes=on xdebug.collect_params=off xdebug.collect_return=off xdebug.default_enable=on xdebug.extended_info=1 xdebug.manual_url=http://www.php.net xdebug.show_local_vars=0 xdebug.show_mem_delta=0 xdebug.max_nesting_level=100 ;xdebug.idekey=; Trace options xdebug.trace_format=0 xdebug.trace_output_dir=/tmp xdebug.trace_options=0 xdebug.trace_output_name=crc32; Profiling xdebug.profiler_append=0 xdebug.profiler_enable=0 xdebug.profiler_enable_trigger=0 xdebug.profiler_output_dir=/tmp xdebug.profiler_output_name=crc32xdebug.remote_connect_back = onxdebug.idekey = "vagrant"


注意事项:



3.vim  bundle 配置

~/.vimrc 需要配置这个

  Plugin 'joonty/vdebug'

如果装vundle  或者vimrc配置可以参考我的其他博文


4.PluginInstall  VundleUpdate VundleInstall 在vim底层命令行模式下 都敲一遍装一波


5. httpd  /  nginx 一定要重启  才能生效php.ini


6.vim xx.php


7.按F5


8.在你的网站后面,浏览器输入

http://develop.xxx.com/?XDEBUG_SESSION_START=1


9.enjoy

\


xdebug大概文档

https://mutelight.org/minimal-guide-to-debugging-php-with-xdebug-and-vim



########## 

github  这个插件的使用文档

https://github.com/joonty/vdebug