[原创]linux系统下xdebug+netbeans的安装配置

本文记录linux系统下xdebug+netbeans的安装配置过程,为PHP程序的调试做好准备。

 

1:根据php的版本下载对应的xdebug

 

# php -version
PHP 5.2.17 (cli) (built: Aug 31 2011 17:06:47)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies


#cd /usr/src
#wget http://xdebug.org/files/xdebug-2.1.2.tgz

2:安装

1)下载安装phpize 和 autoconf

在php-devel包里(Installing: php-devel:5.2.17-jason.2

dependencies:
autoconf        2.59-12                        base                         647 k
automake       1.9.6-2.3.el5                 base                         476 k
imake             1.0.2-3                        base                         319 k

yum -y install php-devel

2)解压缩:
#tar xvf xdebug-2.1.2.tgz
#cd xdebug-2.1.2
#phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519


3)编译安装

(1)安装C编译器,如gcc

#yum install gcc

gcc                    i386                    4.1.2-51.el5

(2)配置,编译,安装

#./configure -enable-xdebug -with-php-config=/usr/bin/php-config

configure: creating ./config.status
config.status: creating config.h

#make
#make install

Installing shared extensions:     /usr/lib/php/modules/

|   INSTALLATION INSTRUCTIONS                                          |
|   See http://xdebug.org/install.php#configure-php for instructions   |
|   on how to enable Xdebug for PHP.                                   |
|   Documentation is available online as well:                         |
|   - A list of all settings:  http://xdebug.org/docs-settings.php |
|   - A list of all functions: http://xdebug.org/docs-functions.php |
|   - Profiling instructions:  http://xdebug.org/docs-profiling2.php |
|   - Remote debugging:        http://xdebug.org/docs-debugger.php |
PHP_OS      : Linux - Linux gxpm.gx.net 2.6.18-274.7.1.el5 #1 SMP Thu Oct 20 16:20:37 EDT 2011 i686
----

3、设置服务器上的xdebug

1)增加配置文件
# vi /etc/php.d/xdebug.ini

;xdebug.remote_host=hhrz.us
;xdebug.remote_port=4663
; add by chq for Xdebug
; Enable xdebug extension module
; extension=xdebug.so
zend_extension="/usr/lib/php/modules/xdebug.so"
[Xdebug]
xdebug.profiler_enable=off
xdebug.auto_trace=off
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.trace_output_dir="/optt/xdebug"
xdebug.profiler_output_dir="/optt/xdebug"

;xdebug.remote_autostart=On
xdebug.remote_enable=On
;xdebug.remote_enable=off
xdebug.remote_handler=dbgp
;xdebug.remote_mode=req
xdebug.remote_host=hhrz.org
xdebug.remote_port=9000

#/etc/init.d/httpd restart

2)重启httpd

 

/etc/init.d/httpd restart

3)建立日志目录

cd /optt
mkdir xdebug
chown optt:optt xdebug
chmod -R 777 xdebug

4、进入netbeans,增加运行配置,开始调试之旅

 

[caption id="attachment_1063" align="alignnone" width="1153"]Xdebug and Netbeans Xdebug and Netbeans [/caption]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值