记录一次PhpStorm配置XDebug
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的, 这步不装插件也没事
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!