环境: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 = On

3、检测当前php 版本应该下载什么xdebug.dll的工具,它会提示应该下载哪个php版本,以及安装配置步骤:Xdebug: Support — Tailored Installation Instructions

4、配置phpstorm

phpstorm断点调试方法图文详解

phpstorm断点调试方法图文详解

phpstorm断点调试方法图文详解

5、配置chome

phpstorm断点调试方法图文详解

phpstorm断点调试方法图文详解

6、开始调试

phpstorm断点调试方法图文详解

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

phpstorm断点调试方法图文详解

按F7,程序会一步一步往下走,碰到函数的话,会跳转到该函数。

按F8,在当前代码页一行一行的往下走,碰到函数不会跳转。

按F9,从某个断点跳到另一行处断点。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。