第一步:安装xdebug扩展
使用xdebug官方提供的一个检测工具:https://xdebug.org/wizard.php
把phpinfo信息填入工具:
image.png
按照提示下载扩展,并将下载好的.dll文件放入指定位置
image.png
在php.ini中加上如下配置:
2018版本
zend_extension = D:\software\phpstudy\php\php-5.6.27-nts\ext\php_xdebug-2.5.5-5.6-vc11-nts.dll
xdebug.remote_enable =1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000
2020版本
[xdebug]
zend_extension=C:\phpstudy_pro\Extensions\php\php7.3.4nts\ext\php_xdebug-3.0.1-7.3-vc15-nts-x86_64.dll
xdebug.mode=debug
xdebug.client_port=9001
重启php,查看phpinfo信息:
image.png
则扩展安装成功
配置phpstorm:
image.png
image.png
postman配置:
1.点击cookies添加cookie如下:
1.png
2.添加域名
2.png
3.点击add cookie,在最前面加上XDEBUG_SESSION=PHPSTORM;即可
3.png