[PHP] phpstorm断点调试方法图文详解

2153 0
黑夜隐士 2023-5-13 13:29:48 | 显示全部楼层 |阅读模式
环境:win10+phpstorm2022+phpstudy8+lnmp
1、phpinfo();  查看是否安装xdebug,没有走以下流程

2、phpstudy中切换不同版本php版本,有些版本不支持xdebug(如php8.0.2),有些已经自带了(如php7.3.9)。已经自带的只需要在php.ini中调用

php.ini 配置文档
[Xdebug]
zend_extension=D:/phpstudy_pro/Extensions/php/php7.3.9nts/ext/php_xdebug.dll
xdebug.idekey=phpstorm
xdebug.remote_enable = On
xdebug.remote_host=localhost
;xdebug.remote_port 默认值为9000,这里需要跟phpstorm配置一致,下面有说明
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.auto_trace = On3、检测当前php 版本应该下载什么xdebug.dll的工具,它会提示应该下载哪个php版本,以及安装配置步骤:Xdebug: Support — Tailored Installation Instructions

4、配置phpstorm







5、配置chome





6、开始调试



刷新浏览器网页,出现以下对勾,表示配置成功


按F7,程序会一步一步往下走,碰到函数的话,会跳转到该函数。
按F8,在当前代码页一行一行的往下走,碰到函数不会跳转。
按F9,从某个断点跳到另一行处断点。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2025 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行