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