-
php 打印phpinfo();然后Ctrl + a ; Ctrl + c;
image.png
-
image.png
-
然后会生成这个
image.png
// php.ini
[XDebug]
zend_extension = "C:\php\ext\php_xdebug-2.9.6-7.3-vc15-x86_64.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host="127.0.0.1"
xdebug.remote_port= 9001 // 这个要和phpstorm配置的一样
xdebug.remote_autostart = 1
xdebug.idekey = "phpstorm" // 需要在phpstorm用到
这个配置完成重新phpinfo()一下 会有这个xdebug的模块

各单位注意 !! 只有有了xdebug的时候才可以继续进行 不然要误入歧途、难以自拔。
-
配置phpstorm
这里也是图文说话 思路比较清晰一点(这里用的是中文 需要的去配置一下语言包就好了)
Ctrl + Alt + S 打开设置面板 搜索 "xdebug" 会出现
image.png
-
然后找到 代理口
image.png
-
然后配置服务器
image.png
- 然后配置页面调试
image.png
点击编辑配置
image.png
- 然后添加PHP Web Page
image.png
把刚刚的配置好的服务器选择一下
image.png
- 默认浏览器 以及默认调试的路径
测试Xdebug

打开这个 然后点击验证 ;调试成功界面 如下

chrome 安装Xdebug 去应用商店搜索 Xdebug Helper


点击debug
断点调试

画蓝色线的状态一定要和我一样 然后点击画红色线的小瓢虫
然后随便来几个断点

然后下图是运行成功的状态

最后可以看见 调试器

这个亚子 就完成啦 如果觉得有帮助 请给小编一个star
你的star✨、点赞和关注是我持续创作的动力!
网友评论