簡體   English   中英

如何使用 Laradock 和 PhpStorm 配置 Xdebug

[英]How to configure Xdebug with Laradock and PhpStorm

我正在嘗試使用 PhpStorm 和 Laradock 配置 Xdebug。

我從這個開始: https://laradock.io/documentation/#install-xdebug

我可以看到 Xdebug 正在工作:

php-fpm/xdebug status
 with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans

這是我的 PhpStorm 配置: 在此處輸入圖像描述 在此處輸入圖像描述 在此處輸入圖像描述 在此處輸入圖像描述 在此處輸入圖像描述 在此處輸入圖像描述

我添加了一個斷點,調試器沒有停止。

誰能看到我做錯了什么?

我的項目在/code/test中,即服務器上的/var/www Laradock 在/code/laradock

更新: Xdebug 日志顯示:

[6] Log opened at 2020-07-10 10:44:55
[6] I: Connecting to configured address/port: host.docker.internal:9000.
[6] E: Time-out connecting to client (Waited: 200 ms). :-(
[6] Log closed at 2020-07-10 10:44:55

更新:

將 ini 更改為此(以及 IDE 中的端口):

xdebug.remote_host=192.168.68.101
xdebug.remote_connect_back=0
xdebug.remote_port=9001
[6] Log opened at 2020-07-10 12:11:03
[6] I: Connecting to configured address/port: 192.168.68.101:9001.
[6] E: Time-out connecting to client (Waited: 200 ms). :-(
[6] Log closed at 2020-07-10 12:11:04

我得到了這個工作,我必須做幾件事:

  1. 關閉了我的防火牆。
  2. 改變了我的配置:
xdebug.remote_host="172.17.0.1" # this is listed under docker0 using ifconfig
xdebug.remote_connect_back=0
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM