xdebugを使ったリモートデバッグの設定

php.iniに記述を追加

zend_extensionの下に追加

;xdebuger
zend_extension=/usr/local/lib/php/xdebug.so
xdebug.remote_autostart=On
xdebug.remote_enable=On
xdebug.remote_handler=dbgp

php.iniの設定を反映

# service apache stop
# service apache start
# php -i  |grep xdebug\.remote
xdebug.remote_autostart => On => On
xdebug.remote_enable => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_log => no value => no value
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000

リモートデバッガをインストール

# xdebug-2.0.0RC3/debugclient
# ./configure
# make
# make install

debugclientを動かしてみる

インストールしたdebugclientを起動して

# debugclient
Xdebug Simple DBGp client (0.9.1)
Copyright 2002-2006 by Derick Rethans.

Waiting for debug server to connect.

待ち状態になったらブラウザからPHPの画面を実行してみる

Xdebug Simple DBGp client (0.9.1)
Copyright 2002-2006 by Derick Rethans.

Waiting for debug server to connect.
Connect
<?xml version="1.0" encoding="iso-8859-1"?>
<init fileuri="file:///usr/local/xxx/public_html/index.php" language="PHP" protocol_version="1.0" appid="9571" idekey="root"><engine version="2.0.0RC3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2007 by Derick Rethans]]></copyright></init>
(cmd)

となったらdbgpのコマンドを実行するらしい