[原創]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 NetbeansXdebug and Netbeans [/caption]

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章