1. 安装xdebug扩展
如何确定要下载的版本?
由上,因此我下载的是如图所示的版本
配置xdebug
//php.ini配置文件中
#调试的host
xdebug.remote_host="www.ff.com"
#开启xdebug
xdebug.remote_enable="on"
#扩展的路径
zend_extension="C:\phpStudy\PHPTutorial\php\php-7.0.12-nts\ext\php_xdebug-2.6.0-7.0-vc14-nts.dll"
配置好后,查看phpinfo,确保配置生效
需要确保几项配置:
#调试的host
xdebug.remote_host
#调试的端口
xdebug.remote_port
#开启调试
xdebug.remote_enable
2. 安装浏览器插件
下载Chrome浏览器Xdebug helper扩展
下载并启动调试
3. 配置PHPSTORM
4. 断点调试程序
- 监听,并在需要调试的位置打上断点
- 浏览器中输入url,并打开xdebug-helper的调试模式然后刷新页面