判断应该安装XDebug的版本
-
根据提示下载并配置
- Download php_xdebug-2.9.5-7.2-vc15-x86_64.dll
- Move the downloaded file to D:\xampp\php\ext
- Edit
D:\xampp\php\php.ini
and add the line
zend_extension = D:\xampp\php\ext\php_xdebug-2.9.5-7.2-vc15-x86_64.dll
- Restart the webserver
-
XDebug详细配置
;指定xdebug库文件的绝对路径 zend_extension = D:\xampp\php\ext\php_xdebug-2.9.5-7.2-vc15-x86_64.dll ;开启远程调试,连接和监听主机和端口的调试客户端 xdebug.remote_enable = On ;启用代码自动跟踪 xdebug.auto_trace=On ;允许收集传递给函数的参数变量 xdebug.collect_params=1 ;允许收集函数调用的返回值 xdebug.collect_return=On ;客户机ip xdebug.remote_host="127.0.0.1" ;客户机xdebug监听端口和调试协议 xdebug.remote_port=9000 ;启动调试器协议dbgp xdebug.remote_handler=dbgp ;指定DBGP调试器(IDE)处理程序区分大小写 xdebug.idekey="PHPSTORM" ;启用性能检测分析 xdebug.profiler_enable = On ;关闭性能检测分析触发器 xdebug.profiler_enable_trigger = off ;指定性能分析文件的存放目录 ;xdebug.profiler_output_dir = "d:\tmp" ;指定性能分析文件的名称 ;xdebug.profiler_output_name = cachegrind.out.%t.%p ;指定堆栈跟踪文件的存放目录 ;xdebug.trace_output_dir="d:\tmp" ;指定堆栈跟踪文件的名称 ;xdebug.trace_output_name = trace.%c
phpstorm配置,以TP5为例
-
Create new project:add local server
配置TP5根目录提示没有默认页,勾选不检查HTTP connection解决
-
继续配置web path
-
配置解释器
-
配置xdebug,主要是验证debugger以及配置端口
-
配置phpstorm的Debug Servers
-
配置PHP Remote Debug
-
配置浏览器插件
xdebug-helper-for-firefox
-
断点调试效果