---
title: "PHP XDebug扩展"
author: "berrywu"
date: "2012-04-18T09:28:18Z"
tags: []
categories: ["研发管理"]
slug: "php-xdebug"
draft: false
lastmod: "2012-04-18T09:27:51Z"
id: 1489093
url: "https://berrywu.iteye.com/blog/1489093"
---

XDebug 是一个 php 代码的调试工具, 对程序员调试程序有很大的帮助。很多PHP程序员调试习惯使用echo、print\_r()、var\_dump()、printf()等，但是代码写好了，能运行了，不代表它的质量就过关了。有时候代码没有明显的编写错误，没有显示任何错误信息（如error、warning、notice等），但是这不表明代码就是正确无误的。有时候可能某段代码执行时间过长，占用内存过多以致于影响整个系统的效率，我们没有办法直接看出来是哪部份代码出了问题。这时候我们希望把代码的每个阶段的运行情况都监控起来，XDebug就可以为你做这些事情。更重要的是做为一个开发者，也应该要养成使用调试工具的习惯，这样可以提高开发效率和质量。

XDebug的安装，我自己试过了，挺简单，不懂得可以找我，呵呵。  
以下提供几个参考链接大家也可以自己学着安装。  
Xdebug安装  
[http://www.phpq.net/tutorial/xdebug-install.html](http://www.phpq.net/tutorial/xdebug-install.html)

Xdebug使用  
[http://www.phpq.net/tutorial/xdebug-use.html](http://www.phpq.net/tutorial/xdebug-use.html)

Xdebug配置  
[http://www.phpq.net/tutorial/xdebug-config.html](http://www.phpq.net/tutorial/xdebug-config.html)

Xdebug调试  
[http://www.phpq.net/tutorial/xdebug-debug.html](http://www.phpq.net/tutorial/xdebug-debug.html)

WinCacheGrind工具---BUG日志可视化工具  
[http://www.phpq.net/tutorial/xdebug-wincachegrind.html](http://www.phpq.net/tutorial/xdebug-wincachegrind.html)