eclipse搭建xdebug调试环境

来源:互联网 发布:西安公路研究院java 编辑:程序博客网 时间:2024/05/16 05:46

调试对于程序开发来说是至关重要的,今天搞了下eclipse开发php的调试环境,准备工具如下:

eclipse-php中all in one的版本,里面已经包含了xdebug和zenddebug插件,下载xdebug.dll,可以到官网下载,下载和php相对应的版本,然后把该.dll放在php扩展目录ext下即可。

php.ini增加xdebug的配置如下:

[xDebug]
zend_extension = "D:/php5.4.7/ext/php_xdebug-2.2.1-5.4-vc9.dll"
;开启自动跟踪
xdebug.auto_trace = On
;开启异常跟踪
xdebug.show_exception_trace = On
;开启远程调试自动启动
xdebug.remote_autostart = On
;开启远程调试
xdebug.remote_enable = On
;收集变量
xdebug.collect_vars = On
;收集返回值
xdebug.collect_return = On
;收集参数
xdebug.collect_params = On
xdebug.trace_output_dir="e:/php/debuginfo"
xdebug.profiler_enable=On
xdebug.profiler_output_dir="e:/php/debuginfo"
 
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp

eclipse中php插件只要配置两个地方即可,如下:

下面运行下debug即可在断点中停下来了。