1.首先下載相應的php_xdebug.dll,下載地址:
http://www.xdebug.org/download.php
2.將下載文件復制到你的php下的ext目錄里。
3.編輯php.ini文件,加入下面信息:
[Xdebug] zend_extension=php_xdebug.dll xdebug.profiler_append = 0 xdebug.profiler_enable = 1 xdebug.profiler_enable_trigger = 0 xdebug.profiler_output_name = "cache.out.%t-%s" xdebug.remote_enable = 1 xdebug.remote_mode = "req" xdebug.remote_handler = "dbgp" xdebug.remote_host = "127.0.0.1" xdebug.remote_port = 9000 xdebug.idekey="PHPSTORM" xdebug.remote_autostart = no xdebug.trace_output_dir="../Projects/xdebug" xdebug.profiler_output_dir="../Projects/xdebug" xdebug.idekey="PHPSTORM"
后面的目錄“../Projects/xdebug”為你想要放置Xdebug輸出的數據文件的目錄,可自由設置。
參數參考設置:
xdebug.default_enable=on
;顯示默認的錯誤信息
xdebug.auto_trace=on
;自動打開“監測函數調用過程”的功模。該功能可以在你指定的目錄中將函數調用的監測信息以文件的形式輸出。此配置項的默認值為off。
xdebug.collect_params=on
;打開收集“函數參數”的功能。將函數調用的參數值列入函數過程調用的監測信息中。此配置項的默認值為off。
xdebug.collect_return=on
;打開收集“函數返回值”的功能。將函數的返回值列入函數過程調用的監測信息中。此配置項的默認值為off。
xdebug.max_nesting_level=100
xdebug.profiler_enable=on
;打開效能監測器。
xdebug.remote_enable=on
;是否調試
xdebug.remote_host=localhost
xdebug.remote_port=9000
;調試端口
xdebug.remote_handler=dbgp
;選擇協議
xdebug.trace_output_dir="d:\Temp"
;設定函數調用監測信息的輸出文件的路徑。
xdebug.profiler_output_dir="d:\Temp"
;設定效能監測信息輸出文件的路徑。