phpstrom + xdebug调试方法

下载xdebug并将dll文件放在你PHP安装目录的ext文件夹下
配置php.ini添加:
zend_extension=php_xdebug-2.6.0-7.2-vc15-x86_64.dll
[XDebug]
zend_extension=.\ext\php_xdebug-2.6.0-7.2-vc15-x86_64.dll
;显示默认的错误信息
xdebug.default_enable=on
;打开收集“函数参数”的功能。将函数调用的参数值列入函数过程调用的监测信息中。此配置项的默认值为off。
xdebug.collect_params = 1
;打开效能监测器
xdebug.profiler_enable=on
;自动打开“监测函数调用过程”的功模。该功能可以在你指定的目录中将函数调用的监测信息以文件的形式输出。此配置项的默认值为off。
xdebug.auto_trace=on
;设定函数调用监测信息的输出文件的路径
xdebug.trace_output_dir="D:\PHPSERVER\php\xdebug\trace_output"
;设定效能监测信息输出文件的路径
xdebug.profiler_output_dir="D:\PHPSERVER\php\xdebug\profiler_output"
;远程调试打开
xdebug.remote_enable=on
;远程头请求方式
xdebug.remote_handler=dbgp
;远程地址
xdebug.remote_host=localhost
;远程端口号
xdebug.remote_port=9000

现在查看一下phpinfo,就会看到:
phpstrom + xdebug调试方法
接下来就是配置一下phpstrom:
在setting里边找到如下图位置进行配置:
phpstrom + xdebug调试方法
phpstrom + xdebug调试方法
谷歌浏览器下载Xdebug helper扩展程序,找到phpstrom的IDE key:
phpstrom + xdebug调试方法
然后再设置PHP标签下Debug->DBGp Proxy:
phpstrom + xdebug调试方法
接下来就可以进行调试了。
首先要设置要配置PHP Web Application:
phpstrom + xdebug调试方法
phpstrom + xdebug调试方法
phpstrom + xdebug调试方法
添加断点:
phpstrom + xdebug调试方法
打开监听,就是座机电话形式的按钮,然后点击绿色瓢虫就开始调试了:
phpstrom + xdebug调试方法
phpstrom + xdebug调试方法


上述所有图片中33333都是我的服务器端口,这个需要设置成你自己的服务器端口。