1. 程式人生 > >eclipse搭建xdebug除錯環境

eclipse搭建xdebug除錯環境

除錯對於程式開發來說是至關重要的,今天搞了下eclipse開發php的除錯環境,準備工具如下:

eclipse-php中all in one的版本,裡面已經包含了xdebug和zenddebug外掛,下載xdebug.dll,可以到官網下載,下載和php相對應的版本,然後把該.dll放在php擴充套件目錄ext下即可。

php.ini增加xdebug的配置如下:

[xDebug]
zend_extension = "D:/php5.4.7/ext/php_xdebug-2.2.1-5.4-vc9.dll"
;開啟自動跟蹤
xdebug.auto_trace = On
;開啟異常跟蹤
xdebug.show_exception_trace = On
;開啟遠端除錯自動啟動
xdebug.remote_autostart = On
;開啟遠端除錯
xdebug.remote_enable = On
;收集變數
xdebug.collect_vars = On
;收集返回值
xdebug.collect_return = On
;收集引數
xdebug.collect_params = On
xdebug.trace_output_dir="e:/php/debuginfo"
xdebug.profiler_enable=On
xdebug.profiler_output_dir="e:/php/debuginfo"
 
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp

eclipse中php外掛只要配置兩個地方即可,如下:

下面執行下debug即可在斷點中停下來了。