php开启xdebug,使用PHPStrom调试

php开启xdebug,使用PHPStrom调试

一、配置php的xdebug功能
我的php是7.4.16最新版本
1.1 使用php自带的xdebug.gll - 正常这是2.8.1版本
php.ini中

[Date]
date.timezone = "Asia/Shanghai"
[xdebug]
zend_extension = C:\xampp\php\ext\php_xdebug.dll
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9003
xdebug.remote_autostart = 1
xdebug.idekey = "PHPSTORM"
xdebug.remote_mode = "req"
xdebug.profiler_output_name ="cache.out.%t-%s"

这个设置没有任何问题,没任何报错,推荐使用
1.2 下载xdebug插件 xdebug
xdebug 3.x配置

[xdebug]
zend_extension = C:\xampp\php\ext\php_xdebug-3.0.3-7.4-vc15-x86_64.dll
xdebug.remote_enable = 1
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9003
xdebug.remote_mode="req"
xdebug.idekey = "PHPSTORM"
xdebug.mode= "develop,debug"

xdebug 2.x配置

[xdebug]
zend_extension = C:\xampp\php\ext\php_xdebug-2.9.8-7.4-vc15-x86_64.dll
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9003
xdebug.remote_autostart = 1
xdebug.idekey = "PHPSTORM"
xdebug.remote_mode = "req"
xdebug.profiler_output_name ="cache.out.%t-%s"

二、配置PHPStrom
File->Setting->Languages & Frameworks->PHP->Debug->validate进行校验,加断点,测试
注意:使用php自带的dll,则校验正常无任何报错
如果使用最新网站上下载的dll,无论是2.x还是3.x
都会有一个提示Debug protocol ‘’ is not supported的告警但是不影响使用
File->Setting->Languages & Frameworks->PHP->Debug->DBgp proxy->PHPSTORM localhost 80
File->Setting->Languages & Frameworks->PHP->Server->localhost 80 xdebug

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值