Homestead環境下怎麼配置PhpStorm Xdebug進行調試,以下這篇文章跟大家介紹一下PhpStorm Homestead 配置 Homestead 怎麼配置 xdebug 進行調試(PhpStorm)的方法,希望對大家有幫助!
![Homestead 怎麼配置 xdebug 進行調試(PhpStorm)](https://img.php.cn/upload/article/000/000/024/61c5396cb79a7425.jpg)
環境
- windows10
- PhpStorm v2019.1.3
- homestead v7.2 (ubuntu18.04 )
- laravel 5.8.* (vhost: laravel.test)
- #請按照你的實際環境來配置, 並不是非得按照我文章中這樣的, 但是配置過程大體類似.. .
Tips
##記得PhpStorm 需要 - PhpStorm v2019.1.3
以上
#在訪問的時候需要加 - ? Homestead 怎麼配置 xdebug 進行調試(PhpStorm)_session_start=vagrant
, 這個
vagrant 不是固定的, 最好用
phpinfo 看下
配置PHP 版本
File => settings => languages & Frameworks => PHP
此時如果你的PHP 版本無法選擇, 請看這篇文章最後的小技巧
![Homestead 怎麼配置 Homestead 怎麼配置 xdebug 進行調試(PhpStorm) 進行調試(PhpStorm)](https://img.php.cn/upload/article/000/000/024/9ad28f16de4564c876cb39cd83616bf9-0.png)
![选择 CLI Interpreter](https://img.php.cn/upload/article/000/000/024/9ad28f16de4564c876cb39cd83616bf9-1.png)
![Homestead 怎麼配置 Homestead 怎麼配置 xdebug 進行調試(PhpStorm) 進行調試(PhpStorm)](https://img.php.cn/upload/article/000/000/024/cdb3cce55bf989619b39b35205fd984b-2.png)
![Homestead 怎麼配置 Homestead 怎麼配置 xdebug 進行調試(PhpStorm) 進行調試(PhpStorm)](https://img.php.cn/upload/article/000/000/024/cdb3cce55bf989619b39b35205fd984b-3.png)
#設定專案目錄對映
Local Path: 是windows 主機上的目錄- Remote Path: 是homestead 中的目錄
-
配置Homestead 怎麼配置 xdebug 進行調試(PhpStorm)
![Homestead 怎麼配置 xdebug 進行調試(PhpStorm)](https://img.php.cn/upload/article/000/000/024/67ce18e26c1384c1c96f2dc32c3ef666-5.png)
![Homestead 怎麼配置 xdebug 進行調試(PhpStorm) mapping](https://img.php.cn/upload/article/000/000/024/67ce18e26c1384c1c96f2dc32c3ef666-6.png)
斷點測試
![Homestead 怎麼配置 xdebug 進行調試(PhpStorm)](https://img.php.cn/upload/article/000/000/024/67ce18e26c1384c1c96f2dc32c3ef666-7.png)
![Homestead 怎麼配置 xdebug 進行調試(PhpStorm)](https://img.php.cn/upload/article/000/000/024/24dd77df4c45604f724f16e5dc94e00c-8.png)
注意點:
一定要開啟debug監聽- 一定要在瀏覽器後面加上
- ?XDEBUG_SESSION_START=vagrant
這個參數, 如果不想每次加這個東西, 也可以安裝chrome 插件
- ?XDEBUG_SESSION_START=vagrant
這個
vagrant 不是固定的, 是php.ini 中設定的那個
IdeKey 的值
最終效果:
![Homestead 怎麼配置 xdebug 進行調試(PhpStorm)](https://img.php.cn/upload/article/000/000/024/24dd77df4c45604f724f16e5dc94e00c-9.png)
小技巧
#如果你的- PHP language level
無法選擇, 你可以對嘗試以下設定
相關推薦:最新的五個Laravel影片教學
#
以上是Homestead 怎麼配置 xdebug 進行調試(PhpStorm)的詳細內容。更多資訊請關注PHP中文網其他相關文章!