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 那邊訪問搞定!!
相關文章
相關標籤/搜索