Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Xdebug问题:连接到客户端超时(等待时间:200毫秒):-(_Php_Phpstorm_Xdebug - Fatal编程技术网

Php Xdebug问题:连接到客户端超时(等待时间:200毫秒):-(

Php Xdebug问题:连接到客户端超时(等待时间:200毫秒):-(,php,phpstorm,xdebug,Php,Phpstorm,Xdebug,我在Xdebug日志中不断遇到此错误: 连接到客户端超时(等待:200毫秒):-( PhpStorm中的调试器根本不起作用 $ php -v PHP 7.3.21 (cli) (built: Aug 4 2020 11:21:19) ( ZTS MSVC15 (Visual C++ 2017) x64 ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.21, Copyright (c) 1998-2018 Zend Technol

我在Xdebug日志中不断遇到此错误:

连接到客户端超时(等待:200毫秒):-(

PhpStorm中的调试器根本不起作用

$ php -v
PHP 7.3.21 (cli) (built: Aug  4 2020 11:21:19) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.21, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans
我的PHP Ini:

[xdebug]
zend_extension=".../php_xdebug-2.9.6-7.3-vc15-x86_64.dll"
xdebug.profiler_append=0
xdebug.profiler_enable=1
xdebug.profiler_enable_trigger=0
xdebug.profiler_output_dir = ".../tmp"
xdebug.profiler_output_name = "xdebug_profile.%R::%u"
xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_mode=req
xdebug.remote_port=9001
xdebug.auto_trace=1
xdebug.collect_includes=1
xdebug.collect_params=1
xdebug.idekey=PHPSTORM
xdebug.remote_autostart=1
xdebug.remote_log=".../logs/xdebug.log"
;xdebug.remote_connect_back=1
注销:

==> xdebug.log <==
[17080] Log opened at 2021-02-18 20:10:25
[17080] I: Connecting to configured address/port: 127.0.0.1:9001.
[17080] E: Time-out connecting to client (Waited: 200 ms). :-(
[17080] Log closed at 2021-02-18 20:10:25

==>xdebug.log在搜索中,我发现有什么东西阻止了从docker到端口9000 9003上本地机器的请求。最后,我通过向ubuntu ufw防火墙添加新的2条规则解决了这个问题,一切正常

sudo ufw allow in from 172.16.0.0/12 to any port 9000 comment xDebug9000
sudo ufw allow in from 172.16.0.0/12 to any port 9003 comment xDebug9003
具体来说,您需要打开端口9001。如上面的示例所示。 另外,我在本地网络上指定了我的IP,而不是xdebug.client_host中的localhost

Address:   172.16.0.0            10101100.0001 0000.00000000.00000000
Netmask:   255.240.0.0 = 12      11111111.1111 0000.00000000.00000000
Wildcard:  0.15.255.255          00000000.0000 1111.11111111.11111111
=>
Network:   172.16.0.0/12         10101100.0001 0000.00000000.00000000 (Class B)
Broadcast: 172.31.255.255        10101100.0001 1111.11111111.11111111
HostMin:   172.16.0.1            10101100.0001 0000.00000000.00000001
HostMax:   172.31.255.254        10101100.0001 1111.11111111.11111110
Hosts/Net: 1048574               (Private Internet)

您禁用了“可以接受外部连接”选项。请检查它的功能:感谢您的回复。我更改了它。它在代码的第一行停止,但不允许我继续。在点击F8后,进程已完全冻结。在我单击红方块(停止)后图标,然后它继续移动并在其他断点上完成它。在我看来,它似乎与xdebug.remote\u handler=dbgp有关。由于它给了我“timeout”错误,我想知道它可能与本地代理设置有关。1)
xdebug.remote\u handler
--自2.9.0以来没有做任何事情--请参阅2)“Your”冻结“描述对我来说没什么意义。但尝试将“最大同时连接数”增加到3。3) 您同时启用了探查器和调试器——将它们同时启用没有什么意义。4) 我建议您将IDE升级到最新的2020.3.2版本(如果您无法升级,那么至少尝试一下它在那里的工作方式)。5)您可以禁用“PHP脚本中第一行中断”和其他2个“强制中断…”选项,并查看它的行为。如果它不再停止,那么您就有一些路径映射问题等。