一,配置wamp安裝目錄下的 \bin\apache\apache2.4.9\bin 目錄下的php.ini文件,下拉到最下面,配置[xdebug]:php
[xdebug]
xdebug.remote_enable = on
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "D:/Software/wamp/tmp" (這一行改爲本身的目錄)
xdebug.show_local_vars=0
xdebug.remote_handler=dbgp
;設置xdebug的端口爲9001
xdebug.remote_port = 9001
;設置idekey
xdebug.idekey="PHPSTORM"web
二,在配置具體的項目以前,咱們先配置好默認設置(default setting),避免每次創建項目都要進行的重複操做apache
1.點擊File → Default Setting → Languages & Frameworks → PHP 如圖:app
2.彈出interpreters窗口ide
3.debug
4.正常狀況下,配置好以後會顯示xdebug版本3d
5.設置xdebug端口號調試
6.設置 DBGp Proxyblog
三,默認設置已經設置好,接下來導入或者打開一個工程,開始設置(File → Setting)rem
1.設置Servers,點擊綠色的「+」配置一個新的Server
2.接下來設置運行配置(Run → Edit Configuration),設置默認的PHP web application配置
3.新建一個php web application
4.設置好斷點並開始調試
5.調試成功,如圖: