Vagrant ( WSL ) + PHPStorm + Xdebug 断点调试环境搭建

1.Vagrant (LInux)环境下 Xdebug 配置 :浏览器

zend_extension=xdebug.so
xdebug.remote_enable = 1 
xdebug.remote_connect_back = 1 
xdebug.remote_port = 9100
xdebug.idekey = "PHPSTORM"  
xdebug.remote_autostart = 1 
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"

2.PHPtorm 配置:
image.pngapp

设置好端口,和Xdebug 设置的同样:

image.png

设置好 目录映射,这很关键

image.png

配置完成,测试debug

RUN->Start Listening for PHP debug connections->打断点->debug
image.pngide

若是调试过程当中遇到这种状况, 是由于调试代码没有映射好, 直接点击 click to set up path mapping, 映射好代码就能够继续调试了。
image.png测试

image.png

浏览器访问网站, PHPstorm 那边访问搞定!!
相关文章
相关标签/搜索