简体   繁体   English

如何使用 Laradock 和 PhpStorm 配置 Xdebug

[英]How to configure Xdebug with Laradock and PhpStorm

I'm trying to configure Xdebug with PhpStorm and Laradock.我正在尝试使用 PhpStorm 和 Laradock 配置 Xdebug。

I started with this: https://laradock.io/documentation/#install-xdebug我从这个开始: https://laradock.io/documentation/#install-xdebug

I can see that Xdebug is working:我可以看到 Xdebug 正在工作:

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

This is my PhpStorm config:这是我的 PhpStorm 配置: 在此处输入图像描述 在此处输入图像描述 在此处输入图像描述 在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

I added a breakpoint and the debugger is not stopping.我添加了一个断点,调试器没有停止。

Can anyone see what I am doing wrong?谁能看到我做错了什么?

My project is in /code/test which is /var/www on the server.我的项目在/code/test中,即服务器上的/var/www Laradock is in /code/laradock Laradock 在/code/laradock

UPDATE: Xdebug log shows:更新: 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

Update:更新:

changed ini to this (and port in IDE):将 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

I got this working, I had to do a couple of things:我得到了这个工作,我必须做几件事:

  1. Turned my firewall off.关闭了我的防火墙。
  2. changed my config:改变了我的配置:
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