システム部の稲葉です。
xamppとNetBeansを結びつける縁の下の力持ち。
そんな存在なのがxdebugです。
公式サイトはこちら
http://xdebug.org/
xamppがインストール済みならば、
C:\xampp\php\php.ini
の一番下を以下のように書き換えてapacheの再起動すると使えるようになります。
[XDebug] zend_extension = "\xampp\php\ext\php_xdebug.dll" xdebug.profiler_append = 0 xdebug.profiler_enable = 1 xdebug.profiler_enable_trigger = 0 xdebug.profiler_output_dir = "\xampp\tmp" xdebug.profiler_output_name = "cachegrind.out.%t-%s" xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp" xdebug.remote_host = "127.0.0.1" xdebug.remote_port = 9000 xdebug.trace_output_dir = "\xampp\tmp"
ちなみに以下のようにするとほかのマシンからデバッグすることができるようになります。
;xdebug.remote_host = "127.0.0.1" xdebug.remote_connect_back = on;
NetBeansとXDebugを組み合わせたときの小ネタ
Q.index.html->xx.phpを呼ぶフォームみたいなのが止まらない・デバッグできない
A.htmlを拡張子phpにして、<?php ; /* debug用 ?>とかいれてブレークを貼るとデバッグできるようになります
Q.毎回index.phpで勝手に止まって困る
A.オプション→PHP→デバッグ→最初の行で停止のチェックを外すと毎回index.phpで止まらないのでいい感じになります。(ただしブレークで止めたときにアクティブウィンドウがブラウザのままなので注意)