1:下载xDebug,http://www.xdebug.org/files/php_xdebug-2.1.2-5.2-vc6.dll,然后将其拷贝到D:\Program Files\php5\ext目录下,修改文件D:\Program Files\php5\php.ini,在文末添加内容:
;xdebug配置
[xDebug]
;载入Xdebug
zend_extension_ts="D:/Program Files/php5/ext/php_xdebug-2.1.1-5.2-vc6.dll"
xdebug.remote_enable=1
;IP
xdebug.remote_host=127.0.0.1
;port
xdebug.remote_port=9000
;無程處理
xdebug.remote_handler=dbgp
;xdebug配置
;开启自动跟踪
xdebug.auto_trace = On
;开启异常跟踪
xdebug.show_exception_trace = On
;开启远程调试自动启动
xdebug.remote_autostart = On
;开启远程调试
;收集变量
xdebug.collect_vars = On
;收集返回值
xdebug.collect_return = On
;收集参数
xdebug.collect_params = On
然后重启apache
2: 配置MyEclipse环境。打开Preferences,定位PHPeclipse,
XDebug的PHP Inerpreter修改成:D:\Program Files\php5\php.exe
Project Defaults的Project URL修改成:http://localhost/,DocumentRoot修改成:D:\Program Files\php5\PHPWeb
PHP External Tools的Run PHP command修改成:D:\Program Files\php5\php.exe,Parser command修改成:"D:\Program Files\php5\php.exe" -l -f {0}
3:配置调试。右击工程,选择Debug As\Debug Configurations,选择PHP XDebug Remote Script,新建一个配置:
Main的Project选择一下,Ide Identification String设置成testID
Pathmap下点New,Local_Path和Remote Path都设置成D:/Program Files/php5/PHPWeb