安装与使用PHP的xdebug扩展 浏览器访问只包含
php phpinfo();
的php文件,查看php详情。[xdebug];zend_extension:Xdebug扩展绝对路径zend_extension=D:/phpstudy_pro/Extensions/php/php7.3.4nts/ext/php_xdebug.dll;xdebug.profiler_enable:0 为关闭,1 为开启(或On与Off)xdebug.profiler_enable=1;xdebug.profiler_enable_trigger: 有关触发器的设置,写 0 即可xdebug.profiler_enable_trigger=0;xdebug.profiler_output_dir:Xdebug 日志记录的地址xdebug.profiler_output_dir=D:/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.profiler;xdebug.trace_output_dir:xdebug.trace_output_dir=D:/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.trace;xdebug.profiler_output_name: 日志输出格式xdebug.profiler_output_name="xdebug.cache.%t-%s";xdebug.profiler_append:xdebug.profiler_append=0;xdebug.remote_enable: 远程调试功能,0 关闭,1 开启,(断点调试为远程)xdebug.remote_enable=1;xdebug.remote_host: 联调的 URL 主机地址xdebug.remote_host="localhost";xdebug.remote_port: 联调的端口xdebug.remote_port=9000;xdebug.remote_handler:调试函数,默认 dbgp,不要对其修改xdebug.remote_handler="dbgp";xdebug.idekey:与 PhpStORM 连接时的确认口令,默认 PHPSTORM(断点调试时phpinfo()输出里它可能会发生变化)xdebug.idekey=PHPSTORM
注:遇到过更改phpstorm的xdebug端口后,不立即生效,可以重启phpstorm解决。
文件-》设置-》语言&框架-》PHP-》Debug-》确认“Xdebug”内设置的端口与php.ini中一致
文件-》设置-》语言&框架-》PHP-》Server-》如图所示,新增自己的域名(或访问路径)
点击phpstorm内按钮触发断点调试。
打开“运行/调试配置”(PhpStorm第二行的运行“三角符号”前)-》点击新增的“+”按钮(不是Templates内)-》PHP WEB Page(我的是web调试,可自选)-》设置“Server”和Start URL(只是url,只是给浏览器用,与调试哪个文件无直接关系,参考下方生成的Url)等。
设置断点-》点击“甲虫”按钮-》自动调起浏览器-》返回phpstorm查看
注:可方便地调试任意文件,但是phpstorm中无此域名server时,会要求创建server,否则无法调试。
注:Xdebug helper插件有时会启用远程调试,但并不显示,需手动点击“Disable”关闭。
注:需要打开chrome开发者模式
下载插件:国内无法在chrome“插件管理”内直接搜索下载,可以使用第三方下载(插件小屋:Xdebug helper1.6.1)或我保存的下载
安装插件:打开chrome的“扩展程序”,将压缩包内的插件文件拖动到“扩展程序”页面,完成安装。
在插件的“甲虫”图标上右键,点击“选项”,设置IDE key为PhpStorm(视IDE情况而定),保存。
相关参考:
推荐:PhpStorm Xdebug 断点调试工具的安装
国内第三方下载:Xdebug helper
来源地址:https://blog.csdn.net/weixin_40277264/article/details/128726521
--结束END--
本文标题: php 断点调试 PHPStorm Xdebug helper
本文链接: https://www.lsjlt.com/news/429425.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0