之前一直没有配置成功phpstorm+xdebug远程调试
还是要多多熟悉一下phpstorm,虽然vs code也是很不错的调试工具,但是用phpstorm可以看的更清晰一点
由于要php7的环境,于是phpstudy切换到php7
![10651191-979890c9abbb592c.png](https://i-blog.csdnimg.cn/blog_migrate/20f5f9ab3ce36af1213021116ad1dd32.png)
phpstudy
然后将phpinfo导出
![10651191-d2b6de8b97edce1c.png](https://i-blog.csdnimg.cn/blog_migrate/0302bed42966655d1bc1aa7ce6f4f930.png)
phpinfo
去xdebug官网https://xdebug.org/wizard.php
将phpinfo信息粘贴,然后按步骤来
![10651191-6be7511c7ca211c2.png](https://i-blog.csdnimg.cn/blog_migrate/95f08759c5d989ca4d0b91f9c57a6f18.png)
xdebug
由于要在phpstorm中调试
最后的配置文件如下:
[XDebug]
xdebug.profiler_output_dir="E:\ProgramFiles\phpstudy\PHPTutorial\tmp\xdebug"
xdebug.trace_output_dir="E:\ProgramFiles\phpstudy\PHPTutorial\tmp\xdebug"
zend_extension=E:\ProgramFiles\phpstudy\PHPTutorial\php\php-7.1.13-nts\ext\php_xdebug-2.7.2-7.1-vc14-nts.dll
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
chrome安装插件
![10651191-4b9e4f2cfbeb1d23.png](https://i-blog.csdnimg.cn/blog_migrate/ac2cd58cbe746dcfa42b0c796b3a14e6.png)
设置IDEKey
然后刷新一下页面就成了
![10651191-1154577dedcd1dca.png](https://i-blog.csdnimg.cn/blog_migrate/038eb04d730843dd9e1dbf7b4343586c.png)
单步调试