PhpStorm + xdebug 配置(一看就会)
2020-03-16 本文已影响0人
Ultra_efficient
第一步:下载 php_xdebug.dll 扩展和 xdebug helper 插件
① php_xdebug.dll
下载并安装

注意:把下载下来的 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"
; 这个和后面是进行关联的
xdebug.idekey = PHPSTORM
以上具体的参数可以去官网进行搜索
第三步:配置 PHPSTORM 和 xdebug helper
配置 PHPStorm
Ctrl + Alt + s
打开设置



配置 xdebug helper
右键扩展->选项

最后一步:使用
域名 xdebugtest.com
① 打开 xdebug helper 调试开关

② 打开 phpstrom 监听 xdebug 开关

③ 打断点开始调试
打断点

打开 xdebugtest.com
并刷新页面,如下

快捷键 F7 继续向下逐步执行进行调试。