第一次:xdebug调试成功记录
一、环境
1、按xdebug.org官网的提示需要PHP7.0以上
2、win10
3、PHPSTUDY
二、设置
1、https://xdebug.org/download.php中点击 custom installation instructions,然后将phpinfo();函数获取的信息粘贴到文本框,系统自动分析对应的xdebug版本并下载
2、将xdebug放到对应的PHP版本的ext文件夹下
3、对应PHP版本的php.ini最底部配置
zend_extension = D:\phpStudy\PHPTutorial\php\php-7.0.12-nts\ext\php_xdebug-2.6.1-7.0-vc14-nts.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_idekey="PHPSTORM"
4、PHPSTORM中配置好后,在浏览器刷新页面则进入调试页面。
参考文档 https://coding.imooc.com/lesson/97.html#mid=3320
第二次php7.0.12 配置phpstorm+thinkphp+xdebug 2019.11.4
1、切换到php7.0.12,将phpinfo的信息全部复制到https://xdebug.org/wizard
得出以下信息,并按以下信息操作:
Instructions
- Download php_xdebug-2.8.0-7.1-vc14-nts.dll
- Move the downloaded file to D:\phpStudy\PHPTutorial\php\php-7.1.13-nts\ext
- Edit
D:\phpStudy\PHPTutorial\php\php-7.1.13-nts\php.ini
C:\Windows\php.ini and add the linezend_extension = D:\phpStudy\PHPTutorial\php\php-7.1.13-nts\ext\php_xdebug-2.8.0-7.1-vc14-nts.dll
- Restart the webserver
2、当phpinfo中有xdebug的版本信息表示安装成功
;xdebug.remote_idekey="PHPSTORM" 这个设置无效
xdebug.idekey="PHPSTORM"; 这个设置phpstorm才有效
按照这个设置测试成功:https://www.cnblogs.com/jingmin/p/6371873.html
File->setting配置
configurations配置(phpstorm右上角)
做好以上配置之后,点击右上角的虫子,会在浏览器打开配置好的打开的网页,假如打开的是注册页,则输入注册信息会自动又切加到PHPstorm,然后进行断点调试。
通过注释掉php.ini的相关配置再重启服务器才能停止xdebug服务(目前的方法)
其它参考文档: