现象:在使用phpStorm进行Debug时(phpStorm断点调试),警告提示:debug session was finished without being ……,如下:
It may be caused by path mappings misconfiguration or not synchronized local and remote projects. To figure out the problem check path mappings configuration for ‘w4.com.server’ server at PHP|Servers orenable Break at first line in PHP scripts option (from Run menu). Do not show again.
分析:使用phpStorm进行断点调试,需要调试的URL是/dede/aaa/index.php,但是后来又需要调试/dede/article_add.php,就出现上面提示的警告了。大致意思就是什么路径映射问题,但是真不明白所以然,还好,最后还是解决掉了这个问题。
解决一:这个提示里面给了解决方案(红字部分),就是勾选菜单中 run 下的 Break at first line in PHP scripts 项。此法每次都能捕捉断点,但是都停留在首页第一行。
解决二:在地址栏加上:
?XDEBUG_SESSION_START=PHPSTORM
结果类似/dede/article_add.php?XDEBUG_SESSION_START=PHPSTORM,即可在想下断点的地方捕捉到断点。