[XDebug] zend_extension = "e:\xampp\php\ext\php_xdebug.dll" ;显示错误的跟踪信息 xdebug.default_enable=1 ;开启自动跟踪 xdebug.auto_trace = 1 ;开启异常跟踪 xdebug.show_exception_trace = 1 ;收集变量 xdebug.collect_vars = 1 ;收集返回值 xdebug.collect_return = 1 ;收集参数 xdebug.collect_params = 1 ;打开xdebug的性能分析器,以文件形式存储 xdebug.profiler_enable = 1 xdebug.profiler_enable_trigger = 0 xdebug.profiler_output_dir = "e:\xampp\tmp" ;性能分析文件的命名规则 xdebug.profiler_output_name = "cachegrind.out.%t-%s" ;函数调用跟踪信息输出文件目录 xdebug.trace_output_dir = "e:\xampp\tmp" ;开启远程调试自动启动 xdebug.remote_autostart = 1 ;开启远程调试 xdebug.remote_enable = 1 ;应用层通信协议 xdebug.remote_handler = "dbgp" ;选择debug客户端正在运行的主机,你不仅可以使用主机名还可以使用IP地址 xdebug.remote_host = "localhost" ;这个端口是xdebug试着去连接远程主机的,如果端口冲突,可以更换其他端口 xdebug.remote_port=9000
通过代码设定 xdebug.auto_trace = 0,
并分别使用 xdebug_start_trace() 和 xdebug_stop_trace() 函数启用和禁用跟踪
在php.ini [Xdebug]中增加
xdebug.idekey="PHPSTORM"
在左侧选中DBGp Proxy,右侧输入
IDE Key:PHPSTORM
Host:localhost
Port:9000
方法一
在index.php 中设置断点,点击 菜单栏 那个小虫子调试,如图
方法二:
2.5.2.1在index.php 中设置断点,
2.5.2.2菜单Run->Start Listen PHP Debug Connections 或点击 小虫子右侧 电话筒 图标
2.5.2.3访问地址http://127.0.0.1/index.php 链接成功
我使用过程出现的问题:调试 yii 2 框架时出现次问题,报 502 错误
解决问题方法:
把 xdebug.auto_trace=0 ,重启apache/nginx ,然后用调试方法1,即可正常