安裝xdebug擴(kuò)展
- 安裝步驟執(zhí)行查詢
- 修改xdebug配置
;是否開啟遠(yuǎn)程調(diào)試自動(dòng)啟動(dòng)
xdebug.remote_autostart = On
;是否開啟遠(yuǎn)程調(diào)試
xdebug.remote_enable = On
;允許調(diào)試的客戶端IP
xdebug.remote_host=localhost
;遠(yuǎn)程調(diào)試的端口(默認(rèn)9000)
xdebug.remote_port=9000
;調(diào)試插件dbgp
xdebug.remote_handler=dbgp
;是否收集變量
xdebug.collect_vars = On
;是否收集返回值
xdebug.collect_return = On
;是否收集參數(shù)
xdebug.collect_params = On
;是否開啟調(diào)試內(nèi)容
xdebug.profiler_enable=On
xdebug.idekey = PHPSTORM
- 重啟fpm
配置phpstorm
-
配置PHP版本
-
設(shè)置phpstorm監(jiān)聽xdebug的端口號(hào)蜡秽,默認(rèn)為9000(跟xdebug一致)
-
配置web server,填寫你要xdebug的服務(wù)相關(guān)信息
瀏覽器插件 xdebug helper, 下載好之后點(diǎn)選項(xiàng), IDE選PHPSTORM
PHPSTORM 點(diǎn)菜單欄的Run>Edit Configurations… 在彈出的窗口中添加一個(gè)調(diào)試配置
然后就可以在IDE里面打斷點(diǎn)進(jìn)行斷點(diǎn)調(diào)試了