PhpStrom+火狐+xdebug+postman调试
-
Windows 下安装 Xdebug 扩展,只需下载对应的 xdebug.dll 扩展即可。
-
如下图找到自己的PHP版本,我这里是PHP7.2.8
-
-
配置php.ini ,然后重启服务器
[xdebug]
zend_extension="F:\AppServ\php5\ext\php_xdebug-2.4.1-5.6-vc11.dll" #指定Xdebug扩展文件的绝对路径
xdebug.auto_trace=on #启用代码自动跟踪
xdebug.collect_params=on #允许收集传递给函数的参数变量
xdebug.collect_return=on #允许收集函数调用的返回值
xdebug.trace_output_dir="F:\AppServ\Xdebug" #指定堆栈跟踪文件的存放目录
xdebug.profiler_enable=on #是否启用Xdebug的性能分析,并创建性能信息文件
xdebug.profiler_output_dir="F:\AppServ\Xdebug" #指定性能分析信息文件的输出目录
xdebug.remote_enable = on #是否开启远程调试
xdebug.remote_handler = dbgp #指定远程调试的处理协议
xdebug.remote_host= localhost #指定远程调试的主机名
xdebug.remote_port = 9000 #指定远程调试的端口号
xdebug.idekey = PHPSTORM #指定传递给DBGp调试器处理程序的IDE Key
2 . 打开phpStorm,快捷键Clt+Alt+S打开settings搜索Xdebug.
- 如果在上级菜单栏->PHP中phpStorm没有自动识别php版本,则自己手动添加
2. 进入Settings>PHP>Debug>DBGp Proxy,IDE key 填 PHPSTORM,host 填localhost,port填9000
3. 进入Settings>PHP>Servers,这里要填写服务器端的相关信息,如:name填localhost,host填localhost,port填80,debugger选XDebug
3 . 打开火狐安装扩展Xdebug
下面就可以打断点测试啦;
在postman请求中的COOKIE里加入XDEBUG_SESSION=PHPSTORM则可调起phpstrom的调试功能
在Headers中新增key:Cookie,Value:XDEBUG_SESSION=PHPSTORM