1. php 安裝xdebug擴展
1.1 擴展配置
xdebug.remote_enable=On
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9067
xdebug.remote_handler=dbgp
2. chrome瀏覽器安裝xdebug插件:
chrome-xdebug插件下載
3. phpstorm 配置
3.1 File | Settings | Languages & Frameworks | PHP | Debug 端口號改成9067 並保存。
3.2 (圖1)
點擊圖1 Validate,並通過
(圖2)
Path to create validatation script 是項目入口文件位置。
3.3 點擊StartListening
4. 創建webPage (也叫php web application )
5. 寫相關測試方法,並打上斷點, 啓用debug