PHP-PHP和IDEA调试配置

修订记录版本是否发布
2020-09-23v1.0

一、安装PHP环境.

我安装的是集成环境(MAMP PRO)

二、IDEA安装PHP插件.

image-20200923174840346

三、IDEA配置PHP环境.

image-20200923174941382

image-20200923175011320

点击Open in Editor打开php.ini 配置文件

image-20200923175140222

PHP 的配置文件中php.ini 增加调试配置.


[xdebug]
zend_extension="/Applications/MAMP/bin/php/php7.2.8/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so"

;用来显示错误信息
display_errors = On
html_errors = On

;显示堆栈信息
xdebug.show_local_vars = 1
xdebug.max_nesting_level = 50
xdebug.var_display_max_depth = 6
xdebug.dump_once = On
xdebug.dump_globals = On
xdebug.dump_undefined = On
xdebug.dump.REQUEST = *
xdebug.cli_color = 2


;显示性能信息
xdebug.profiler_enable_trigger = on
xdebug.collect_params = On
xdebug.collect_return = On
xdebug.profiler_enable = On
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.trace_output_dir = "/Applications/MAMP/tmp"
xdebug.profiler_output_dir ="/Applications/MAMP/tmp"

;远程调试配置信息
;开启远程调试
xdebug.remote_enable = On
;远程处理协议
xdebug.remote_handel = dbgp
;IDE所在机器IP
;xdebug.remote_host = 127.0.0.1
;端口号
xdebug.remote_port = 9000
;IDE KEY
xdebug.idekey = "mykey"
xdebug.remote_connect_back= 1

注意:我安装的是集成环境,所有不用单独安装Xdebug,否则需要在安装PHP Xdebug模块。

四、配置 Xdebug调试端口,需要和配置文件中的端口号相同.

image-20200923175615673

五、配置DBGp Proxy

注意:IDE key需要和配置文件中的xdebug.idekey = "mykey"保持一致

image-20200923175703179

六、Google浏览器安装Xdebug helper 插件并进行以下配置.

右键选中🐞,然后选择选项

image-20200923175938384

配置IDE key

image-20200923180100271

选择Debug

image-20200923180144232

七、回到IDEA配置项目debug

image-20200923180349367

选择Debug启动
image-20200923180300800

完成

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

编程秀

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值