phpstorm和postman关于xdebug安装和使用

2020-12-05  本文已影响0人  一梦三四年lyp

一,

查找合适的版本:https://xdebug.org/wizard

安装xdebug扩展并且配置php.ini

zend_extension = D:\phpstudy_pro\Extensions\php\php7.3.4nts\ext\php_xdebug-2.9.6-7.3-vc15-nts-x86_64.dll

xdebug.idekey = PHPSTORM
xdebug.remote_enable=1
xdebug.remote_host=china-made-admin-backend.com
xdebug.remote_port=9100 
xdebug.collect_return=1
xdebug.show_mem_delta=1
xdebug.collect_params=4
xdebug.profiler_enable_trigger = 1
xdebug.profiler_enable_trigger_value=SINA_SCP
xdebug.trace_enable_trigger = 1
xdebug.trace_enable_trigger_value=SINA_SCP

二,phpStorm配置

2.1 端口号和php.ini配置的端口号一致即可。


image.png

2.2 IDE key和xdebug.idekey一致,host当前项目的域名


image.png
3.3 配置servers ,host当前项目的域名 同上。Debugger 选择 Xdebug
image.png

三,PostMan配置
设置cookie XDEBUG_SESSION是调试的时候必须传的参数:XDEBUG_SESSION=PHPSTORM,cookie里就会默认带上该参数

image.png

四,PostMan发起请求,然后再项目里打断点,这时phpstorm 就会有断点信息输出。


image.png image.png
上一篇下一篇

猜你喜欢

热点阅读