0 前沿
① 不推荐google浏览器进行调试,这个试了很多遍都不行
② 可以用Edge浏览器
1 效果
2 phpstudy配置
2.1 开启xdebug扩展
2.2 修改php.ini文件
设置 -> 点击与部署网站同一php版本的文件
添加以下配置:
[Xdebug]
zend_extension=D:/soft/phpstudy_pro/Extensions/php/php7.3.4nts/ext/php_xdebug.dll
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.auto_trace=Off
xdebug.trace_output_dir=D:/soft/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.trace
xdebug.profiler_enable=Off
xdebug.profiler_output_dir=D:/soft/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.profiler
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9005
xdebug.remote_handler=dbgp
xdebug.idekey=PHPSTORM
2.3 重启apache或者nginx
3 phpstorm配置
3.1 file -> settings -> languages & franeworks -> debug
与phpstudy中的php.ini中的xdebug中的port保持一样
3.2 file -> settings -> languages & franeworks -> debug -> DBG Proxy
IDE key:与phpstudy中的php.ini中的xdebug中的idekey保持一样
Port:与phpstudy中的php.ini中的xdebug中的port保持一样
3.3 file -> settings -> languages & franeworks -> servers
3.3 添加Configurations
点击validate显示全部通过才可以,如果没通过的话就再看看问题,我这里是直接全部通过了
4 添加xdebug helper插件
打开edge -> 扩展 -> 搜索xdebug helper -> 添加
5 postman配置
5.1 获取XDEBUG_SESSION
查看网页中调用后端接口中的Cookie中的XDEBUG_SESSION配置:
5.2 配置postman
header中添加Cookie配置