php vagrant vim xdebug配置

本文详细介绍如何在PHP环境中安装并配置Xdebug扩展,包括编译安装步骤、配置php.ini文件的方法、vim插件配置及调试流程。适用于希望提高PHP开发效率的技术人员。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、安装xdebug


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

 
wget http://xdebug.org/files/xdebug-2.3.2.tgz
tar -zxvf  xdebug-2.3.2.tgz
cd  xdebug-2.3.2
phpize
./configure --enable-xdebug --with-php-config=/data/php/bin/php-config
make && 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=crc32

xdebug.remote_connect_back = on
xdebug.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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值