phpでのxdebugインストール


実験環境CentOS
phpinfo()
表示
PHP Version 5.3.3
公式サイトへhttp://www.xdebug.org/ダウンロード対応
xdebug-2.2.5
linuxでxdebugパッケージを解凍します.
1、xdebugに入り、このディレクトリの下でphpディレクトリの下のbin/phpizeを先に実行する.
マイコン、phpizeの実行エラー
[root@localhost xdebug-2.2.5]# phpize
-bash: phpize: command not found

phpizeのインストール
phpizeはphp-develに属する内容です
yum install php-devel -y
[root@localhost xdebug-2.2.5]# phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

2、運転中
[root@localhost xdebug-2.2.5]#./configure --enable-xdebug 
[root@localhost xdebug-2.2.5]#make

はい、コンパイルは終わりました.
[root@localhost xdebug-2.2.5]# ll modules/
total 660
-rw-r--r--. 1 root root    923 Oct 17 06:19 xdebug.la
-rwxr-xr-x. 1 root root 668885 Oct 17 06:19 xdebug.so

これはxdebugのディレクトリの下でディレクトリmodulesを生成する時で、ディレクトリの下にxdebugがあります.soファイル、xdebug.soあなたが置きたいディレクトリにコピーします.
3.phpを編集する.iniファイル
さらにphpのプロファイルの後ろに
zend_extension="/パス/xdebug.so"
次のようになります.
zend_extension="/home/samba/test/xdebug-2.2.5/modules/xdebug.so"
xdebug.profiler_enable = on
xdebug.default_enable = on
xdebug.trace_output_dir="/tmp/xdebug"
xdebug.trace_output_name = trace.%c.%p
xdebug.profiler_output_dir="/tmp/xdebug"
xdebug.profiler_output_name="cachegrind.out.%s"

[root@localhost xdebug-2.2.5]#service httpd restart
phpinfo()
表示
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
wKioL1YiUsbgjHbWAADITac4rsk403.jpg
または
[root@localhost etc]# php -m |grep debug
xdebug
Xdebug