记录一次PhpStorm配置XDebug

发布时间 2023-11-16 12:05:08作者: 悉野

PhpStorm 2023.2.3 + php5.6

参考:PHPStorm官方,  PhpStorm配置Xdebug(超详细),  xdebug下载与配置,有这一篇就够了

1.到官网下载 xdebug dll,  因为我用的是php 5.6的, 所以要下载历史版本的dll

https://xdebug.org/download/historical

我下载的是5.6 TS版本的

Ts与nts的区别:
Windows版的PHP从版本5.2.1开始有Thread Safe和NoneThread Safe之分。
先从字面意思上理解,Thread Safe是线程安全,执行时会进行线程(Thread)安全检查,以防止有新要求就启动新线程的CGI执行方式而耗尽系统资源。Non Thread Safe是非线程安全,在执行时不进行线程(Thread)安全检查。

2.dll放到php的ext目录, 修改php.ini, 加入xdebug配置, 这步好了, 可以查看phpinfo()

[Xdebug]
zend_extension=D:/phpstudy_pro/Extensions/php/php5.6.9nts/ext/php_xdebug.dll
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.auto_trace=Off
xdebug.trace_output_dir=D:/phpstudy_pro/Extensions/php_log/php5.6.9nts.xdebug.trace
xdebug.profiler_enable=Off
xdebug.profiler_output_dir=D:/phpstudy_pro/Extensions/php_log/php5.6.9nts.xdebug.profiler
xdebug.remote_enable=On
xdebug.remote_host=www.demo.com
xdebug.remote_port=9100
xdebug.idekey=PHPSTORM
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1

3. 配置PhpStorm

 

 4.配置一个deubg Configuration

 

5.edge浏览器->扩展, 线上搜索xdebug, 安装xdebug helper, chrome扩展商店打不开来, 所以这儿才用edge的, 这步不装插件也没事