关于php代码调试就不再多说了。用过才知道爽!!!
之前写过一边配置,请查看 关于xdebug配置
关于xdeubg的一些坑
- 用的多了缓存文件太多,造成特别慢
- 自动开启检测,在不使用的时候也回很慢
[xdebug]
zend_extension="/usr/local/opt/php71-xdebug/xdebug.so"
xdebug.auto_trace = On
xdebug.trace_output_dir = "/var/tmp/xdebug"
xdebug.profiler_output_dir = "/var/tmp/xdebug"
xdebug.profiler_enable=0
;是否开启远程调试自动启动
;关闭自动开启调试
xdebug.remote_autostart = 0
;是否开启远程调试
xdebug.remote_enable = On
;允许调试的客户端IP
xdebug.remote_host=localhost
;远程调试的端口(默认9000)
xdebug.remote_port=9001
;调试插件dbgp
xdebug.remote_handler=dbgp
;是否收集变量
xdebug.collect_vars = On
;是否收集返回值
xdebug.collect_return = On
;是否收集参数
xdebug.collect_params = On
;是否开启调试内容
xdebug.profiler_enable=On
;设置php显示的级别长度
xdebug.var_display_max_depth=10
xdebug.idekey = PHPSTORM
xdebug.remote_autostart = 0
这是最重要的。关闭之后,使用google的插件来唤醒ide的debug,可以解决在不使用debug的情况,避免等待时间