[TOC]
# 注:参考文档
《使用XDebug加PHPStorm远程调试PHP》
https://www.mnstory.net/2017/10/14/phpstorm-remote-debug-with-xdebug/
《Howto远程调试服务器上的PHP命令行程序》
http://xnw.com/home.php?act=weibo_detail&wid=3860714&qid=1017754&channel_id=weibo
>先看一下上边两篇文章,大概了解一下原理,但新版的phpstorm和旧版的还是有很大的差距的,注意差别!
# 一:Deployment 部署
## 1.1 Connection
![mark](http://qiniu.newthink.cc/blog/20180108-103003544.png)
## 1.2 Mappings
![mark](http://qiniu.newthink.cc/blog/20180108-094806238.png)
# 二:PHP设置
## 2.1 language level && CLI Interpreter
![mark](http://qiniu.newthink.cc/blog/20180108-101707085.png)
## 2.2 Path mappings
![mark](http://qiniu.newthink.cc/blog/20180108-101800794.png)
## 2.3 Server
目录映射
![mark](http://qiniu.newthink.cc/blog/20180108-103124536.png)
入口映射
![mark](http://qiniu.newthink.cc/blog/20180204-100606467.png)
# 三:Debug 端口
## 3.1 PHP->Debug
![mark](http://qiniu.newthink.cc/blog/20180108-101826535.png)
# 四:设置
## 4.1 Configurations
![mark](http://qiniu.newthink.cc/blog/20180108-101948364.png)
## 4.2 PHP Remote Debug
![mark](http://qiniu.newthink.cc/blog/20180108-102044752.png)
## 4.3 Validate
![mark](http://qiniu.newthink.cc/blog/20180108-102124479.png)
![mark](http://qiniu.newthink.cc/blog/20180108-102213283.png)
# 五:xhell 隧道通信
>注:先打断点,再通信。这里用的是xshell ,当然你可以用其他shell工具。
![mark](http://qiniu.newthink.cc/blog/20180108-102321745.png)
# 六:远程域名调试
>直接看图
![mark](http://qiniu.newthink.cc/blog/20180108-102757846.gif)