1、下载xdebug
http://xdebug.org/download.php
注意:下载的xdebug的版本一定要与php的版本一致,否则安装不成功!
2、在php.ini的最后添加如下代码:
;载入Xdebug
zend_extension_ts="E:\php5.2.13\ext\php_xdebug-2.2.0-5.2-vc9.dll"
;xdebug配置
[Xdebug]
;开启自动跟踪
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.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
3、保存后,重启Apache服务器。
4、编写测试页面
新建一个test.php文件,输入如下内容:
<?php
phpinfo();
?>
文件放置到Aapche服务器如下目录:
E:\Apache HTTP Server2.2\htdocs
通过浏览器,访问http://localhost/test.php
出现上图所示,则配置成功!