1.首先查看项目的php版本
2.开启debug扩展
3.修改对应php的配置文件php.ini
设置端口号9110(可自定义,尽量不要与常用端口号冲突)与idekey,PHPSTORM
[Xdebug]
zend_extension=F:/phpStudy_64/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=F:/phpStudy_64/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.trace
xdebug.profiler_enable=Off
xdebug.profiler_output_dir ="F:\phpStudy_64\phpstudy_pro\Extensions\tmp\xdebug"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9110
xdebug.remote_handler=dbgp
xdebug.idekey="PHPSTORM"
4.浏览器加载xdebug扩展
并设置idekey为phpstorm
5.PHPStorm设置xdebug的端口号,即php.ihi文件配置的端口号
6.phpstorm右上角配置调试
其中服务器配置
OK!
需要token参数debug的话,把XDEBUG_SESSION_START=17014参数复制下来,借助apipost工具测试