1.為php安裝xdebug,方法在上一篇中有詳細介紹
2.注意這個時候需要修改php.ini內容如下:
[Xdebug]
zend_extension_ts ="d:/wamp/php/ext/php_xdebug-2.1.2-5.2-vc6.dll"
xdebug.auto_trace=On
xdebug.collect_params=On
xdebug.collect_return=On
xdebug.trace_output_dir="d:/wamp/php/debuginfo"
xdebug.profiler_enable=On
xdebug.profiler_output_dir="d:/wamp/php/debuginfo"
xdebug.idekey=PhpStorm
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
3.phpstorm配置
- 客戶端調試,打開phpStorm,進入File>Settings>PHP>Servers,這里要填寫服務器端的相關信息,name填localhost,host填localhost,port填80,debugger選XDebug
- 進入File>Settings>PHP>Debug,看到XDebug選項卡,port填9000,其他默認
- 進入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 phpStorm,host 填localhost,port 填80
- 點OK退出設置。
4.瀏覽器設置
chrome有插件xdebug helper下載后,設置白名單為localhost也就是默認localhost,才顯示小蟲子的圖標
5.啟動斷點:
在phpstorm中設置斷點后,啟動監聽,就是電話一樣的圖標,然后用chrome瀏覽localhost中的指定斷點的文件,會自動進入斷點,在phpstorm中看到調試信息。
具體的細節還在學習中。