Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1838852
  • 博文数量: 333
  • 博客积分: 10791
  • 博客等级: 上将
  • 技术积分: 4314
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-08 07:39
文章分类

全部博文(333)

文章存档

2015年(1)

2011年(116)

2010年(187)

2009年(25)

2008年(3)

2007年(1)

分类: Python/Ruby

2010-05-25 18:11:44

Xdebug是一个开放源代码的PHP程序调试器(即一个Debug工具),可以用来跟踪,调试和分析PHP程序的运行状况官方站点:。

下面,是源码安装的具体步骤:

一、解压源码包:

tar xvf xdebug-xxx.taz
cd xdebug-xxx


二、编译

<yourPhpPath>/bin/phpize
./configure --enable-xdebug --with-php-config=<yourPhpPath>/bin/php-config

make


三、配置
    1、将生产的xdebug.so拷贝到php的lib目录下:

cp modules/xdebug.so /lib/php/extensions/no-debug-non-zts-xxx/


    2、编辑php.ini,加入以下内容:

[Xdebug]
zend_extension="/lib/php/extensions/no-debug-non-zts-xxx/xdebug.so"
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.trace_output_name="%H.%s"
xdebug.trace_output_dir="/var/logs/xdebug"
xdebug.profiler_enable=on
xdebug.profiler_output_dir="/var/logs/xdebug"
xdebug.remote_port=7777


四、测试

    1、编写test.php:

<?php
    require_once('inexistence');
?>

注,’inexistence‘为不存在的文件
 
    2、测试结果:

( ! ) Warning: require_once(inexistence) []: failed to open stream: No such file or directory in /usr/local/apache2/htdocs/test.php on line 2
Call Stack
#TimeMemoryFunctionLocation
10.0001319628{main}( )../test.php:0

( ! ) Fatal error: require_once() []: Failed opening required 'inexistence' (include_path='.:/usr/local/php5/lib/php') in /usr/local/apache2/htdocs/test.php on line 2
Call Stack
#TimeMemoryFunctionLocation
10.0001319628{main}( )../test.php:0
阅读(920) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~