如何解决xdebug安装失败

2026年09月26日 09:16
有1个网友回答
网友(1):

http://jingyan.baidu.com/article/0320e2c1f5066a1b86507b6d.html
1
查看错误,错误信息存在apache的logs文件中,

2
下载xdebug方法,到xdebug.org官网下载后放到一个地方即可,推荐存放到php/ext目录中,需要注意的是一定要下载和你的apache和php版本都一致的版本,否则可能会加载失败。
3
安装xdebug方法:在php.info配置文件中添加xdebug配置信息,即可,
[xdebug]
zend_extension=D:/php/php-5.4.31/ext/php_xdebug-2.2.2-5.4-vc9.dll
;zend_extension= /usr/lib/php5/20090626+lfs/xdebug.so (Linux)
xdebug.remote_enable=on
xdebug.remote_handle=dbgp
xdebug.remote_host=127.0.0.1
xdeubg.remote_port=9000
xdebug.idekey="ide.xdebug"
Xdebug.auto_trace = on
;function info formmat
xdebug.profiler_enable=on
;xingneng info
xdebug.trace_output_dir="D:/php/php-5.4.31/xdebug"
;xingneng info
xdebug.profiler_output_dir="D:/php/php-5.4.31/xdebug"
;xingneng info
Xdebug.profiler_output_name="cachegrind.out.%p"

4
重启apache,通过phpinfo查看,如果能看到xdebug说明安装成功,否则请根据第一步查看错误方法 进行排查。成功页面如图:

END
注意事项

下载的xdebug文件名中的版本号分别是apache的版本号和php的版本号,需选择正确
php.info文件中配置加载xdebug目录时都需要写文件的全路径