最初我用的php版本是5.6 ,phpstorm版本是2017.2月版本,配置的xdebug是2.6.1,这三者的版本是兼容的,xdebug断点调试是可以成功的。
最近将php升级到7.3版本,而xdebug也升级到2.8.0,phpstorm版本就没有变动,按部就班的将php.ini配置成如下:
[XDebug]
zend_extension="E:\XAMPP\php\ext\php_xdebug.dll"
xdebug.remote_host=localhost
xdebug.remote_port=9002
xdebug.remote_enable=on
xdebug.auto_trace=on
xdebug.remote_autostart=1
xdebug.remote_handler=dbgp
xdebug.idekey=PHPSTORM
phpstorm配置完全与之前的一致,但是就是调不通,一致报如下错误:
Debug session was finished without being paused
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 'testXdebug' server at PHP|Servers or enable Break at first line in PHP scripts option
xdebug能进入第一行,第2行之后的代码一直调试不了,我试着将如下红线标注的取消掉,一直还是出现上述问题。最后查阅了相关博文之后,可能是由于有php, phpstorm,xdebug三者的版本不兼容造成的。
我随之将phpstorm版本升级到2019.2版本。xdebug果然成功调通。这个浪费了我一上午的时间,现在将这个坑记录下来。