PhpStorm配置xDebug

php的調試環境的配置一貫是比較糾結的,以前在zendstudio中配置了一次,破費周折(具體過程參見:http://blog.csdn.net/dannywj1371/article/details/9272565),今天在phpstorm上配置了一下,現記錄一下詳細過程。php

 

1.安裝好phpstorm(版本7.1.3)。html

2.配置php的xdebug擴展組件。phpstorm

xdebug的安裝成功與失敗須要檢驗一下。有兩種方式:ide

a.在命令行中執行 php –m 沒有報錯而且能夠找到xdebug模塊。網站

b.把phpinfo() 的信息粘貼在xdebug的嚮導頁面中,分析成功。嚮導頁面:http://xdebug.org/wizard.php.net

安裝方法:命令行

a.修改php.ini 添加配置:debug

 

[XDebug]
; Only Zend OR (!) XDebug
zend_extension_ts="E:\xampp\php\ext\php_xdebug-2.2.3-5.2-vc9.dll"
xdebug.auto_trace=On
xdebug.collect_params=On
xdebug.collect_return=On
xdebug.trace_output_dir="e:/xampp/php/debuginfo"
xdebug.profiler_enable=On
xdebug.profiler_output_dir="e:/xampp/php/debuginfo"
xdebug.idekey=PhpStorm
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp調試

因爲在zend_extension_ts配置了dll的引用,所以orm

;extension=php_xdebug-2.2.3-5.2-vc9.dll 這個配置就能夠註釋掉了。不然提示重複加載xdebug

PS具體xdebug的版本若是不一致,能夠參考嚮導頁面的報錯信息,以及根據報錯信息的建議方案進行調整。

 

3.配置phpstorm

image

 

image

 

此處的配置idekey要和php.ini中配置的一致。

 

image

 

加入斷點後要點擊監聽xdebug按鈕,纔可調試。

 

 

參考網站:

http://www.cnblogs.com/jsn521/p/3399997.html
http://www.cnblogs.com/tippoint/p/3429384.html
http://micate.me/phpstorm-xdebug.note

相關文章
相關標籤/搜索