第一步:下載 php_xdebug.dll 擴展和 xdebug helper 插件
① php_xdebug.dll
下載并安裝
post-phpstormxdebug-phpinfo.png
注意:把下載下來的 xdebug.dll 移動到 php 安裝目錄的 ext 目錄。
② Xdebug helper
下載并安裝
第二步:修改 php.ini 配置
配置 php.ini
在 php.ini 追加
[XDebug]
; 這個就是剛才下載的 xdebug.dll
zend_extension=php_xdebug-2.5.1-5.6-vc11-nts.dll
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir ="D:\phpStudy\tmp\xdebug"
xdebug.trace_output_dir ="D:\phpStudy\tmp\xdebug"
xdebug.profiler_output_name = "cache.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.remote_mode = "req"
; 這個和后面是進行關聯(lián)的
xdebug.idekey = PHPSTORM
以上具體的參數(shù)可以去官網(wǎng)進行搜索
第三步:配置 PHPSTORM 和 xdebug helper
配置 PHPStorm
Ctrl + Alt + s
打開設置
post-phpstormxdebug-phpstormconfig1.png
post-phpstormxdebug-phpstormconfig2.png
post-phpstormxdebug-phpstormconfig3.png
配置 xdebug helper
右鍵擴展->選項
2020030910390439SS.png
最后一步:使用
域名 xdebugtest.com
① 打開 xdebug helper 調試開關
2020030910231023SS.png
② 打開 phpstrom 監(jiān)聽 xdebug 開關
2020030910411141SS.png
③ 打斷點開始調試
打斷點
2020030910571257SS.png
打開 xdebugtest.com
并刷新頁面后室,如下
2020030910441344SS.png
快捷鍵 F7 繼續(xù)向下逐步執(zhí)行進行調試救斑。