一、安装xdebug模块
1、去www.xdebug.org下载相应版本php的模块文件,保存下载后的文件到php的ext目录,可以自己修改文件的名称,如保存成:php_xdebug.dll
php.ini中配置
;20190402xdebug
[XDebug]
zend_extension = "D:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "D:\xampp\tmp\xdebug"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = on
xdebug.remote_handler = "dbgp"
xdebug.remote_port = 9018
xdebug.remote_host = "127.0.0.1"
xdebug.remote_autostart = 1
xdebug.auto_trace = 1
xdebug.trace_output_dir = "D:\xampp\tmp\xdebug"
xdebug.idekey= PHPSTROM
2、配置phpstorm
File->Settings->Languages & Frameworks->PHP->Debug->Debug port填9018
启动phpstorm小电话图标,即可运行调试代码