centos5下安装xdebug

我安装的是Xdebug V2.1.0 当前最新版 http://xdebug.org/files/xdebug-2.1.0.tgz
php版本为5.2.5
这里注册怎么它们的版本,版本不对称可能会致使安装失败

安装步骤是:

1,下载 Xdebug tarball(一个用 gzip 压缩的 .tar 归档文件)。wget 命令能够帮助您轻松地完成此操做,你能够在任意目录,我是在root下下载的:
$ wget  http://xdebug.org/files/xdebug-2.1.0.tgz

2,解压缩该 tarball 并切换到源代码目录:
$ tar xzf xdebug-2.1.0.tgz$ 
cd xdebug-2.1.0

3,运行 phpize, 以准备适用于您的 PHP 版本的 Xdebug 代码:
$ phpize
Configuring for:
PHP Api Version:         20020918
Zend Module Api No:      20020429
Zend Extension Api No:   20021010
phpize 的输出是一个脚本 —— 一般名为配置 —— 用于调整其他的构建过程。

我刚开始并无安装phpize,因此报错没有此命令  ,由于PHPize 是属于php 的 devel .因此安装只要: 
$ yum install php-devel

4,运行配置脚本:
开始编译 xdebug:
$ ./configure --with-php-config=/usr/local/php5/bin/php-config

注意
/usr/local/php5/bin/php-config,根据你php的安装来进行填写
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
...
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
configure: creating ./config.status
config.status: creating config.h
5,经过运行 make 构建 Xdebug 扩展:
$ make && make install
/bin/sh /home/strike/tmp/xdebug-2.0.5/libtool
--mode=compile gcc  -I.
-I/home/strike/tmp/xdebug-2.0.5 -DPHP_ATOM_INC
-I/home/strike/tmp/xdebug-2.0.5/include
-I/home/strike/tmp/xdebug-2.0.5/main
-I/home/strike/tmp/xdebug-2.0.5
-I/usr/include/php4 -I/usr/include/php4/main
-I/usr/include/php4/Zend -I/usr/include/php4/TSRM 
-DHAVE_CONFIG_H  -g -O0 -c
/home/strike/tmp/xdebug-2.0.0RC4/xdebug.c -o
xdebug.lo mkdir .libs
...

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).
使用 make 将生成 Xdebug 扩展 xdebug.so。
6,安装该扩展:
$ sudo make install
Installing shared extensions:     /usr/lib/php/modules/

继续以前,使用鼠标选择并复制上一条命令显示的目录。该路径对于最后一步配置扩展相当重要。
在您喜欢的文本编辑器中打开 php.ini 文件,而后添加如下代码:
zend_extension = /usr/lib/php/modules/xdebug.so


第一行将装入 Xdebug 扩展;第二行将禁用 Xdebug 的分析器功能(只是为了简单起见),而第三行将启用扩展的调试功能。
要检验 Xdebug 扩展是否已经安装并启用,请从新启动 Web 服务器,而后用代码 <?php phpinfo(); ?>

若是输出的内容中有看到xdebug,说明安装配置成功。
相关文章
相关标签/搜索