1、下载对应版本 xdebug
下载地址:https://download.csdn.net/download/q2104574/11185239
比如你用的php7.0.12以上的版本,xdebug扩展程序也要对应是7.0的版本,大版本号一致即可,php_xdebug-2.7.0alpha1-7.0-vc14-nts.dll ,我这边是用32位的,64位不行。
2、把文件丢到php版本下的文件夹
C:phpStudyPHPTutorialphpphp-7.0.12-ntsext
3、配置php.ini
C:phpStudyPHPTutorialphpphp-7.0.12-ntsphp.ini
拉到最下面,找到xdebug的配置节点,填入一下信息,重启phpstudy
[XDebug]
;; Only Zend OR (!) XDebug
zend_extension = C:phpStudyPHPTutorialphpphp-7.0.12-ntsextphp_xdebug-2.7.0alpha1-7.0-vc14-nts.dll
xdebug.remote_enable =1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
重启phpstudy,打开phpinfo页面,搜索xdebug 找的到就算安装成功,找不到的话请安装64位版本,或者php版本跟xdebug不对
4、下载浏览器插件xdebug并且安装开启
(我这边是chrome),每个浏览器都有 ,如谷歌就搜索 chrome xdebug 、360xdebug。。。。
下载地址:https://download.csdn.net/download/q2104574/11185215
装完插件后,点击插件,点击Debug,即开启
5、在phpstorm,点击进行断点,记住一点是要本页面的后台
6、phpstorm 开启调试(变绿色即开启)
7、运行页面,进到断点接口对应的触发页面,会自动进入断点
鼠标移上去变量,会出现值,下面的对话框也可以查看值,数组什么的点加号可以点开。