Guzzle 和 XDebug 超时
Guzzle and XDebug timeout
我正在使用 Xdebug 调试带有 guzzle curl 调用的代码。
在任何其他代码中,Xdebug 工作正常。
但是每当有客户端调用 Guzzle 时,我得到的只是超时。
我正在使用:
- Php风暴2017.2
- Docker,带图像
richarvey/nginx-php-fpm:latest
(nginx+php fpm)
- Xdebug Php 7.1
这是代码片段,它在此处冻结:
public function fetch(): string
{
$content = '';
$completePath = self::FETCH_PATH . $this->id;
$request = $this->httClient->get($completePath);
if ($request->getStatusCode() == 200) {
$content = $request->getBody()->getContents();
}
return $content;
}
我遇到了同样的问题。我相信当两个不同的 php 进程尝试使用相同的 IDE KEY 同时打开 Xdebug 连接时会出现问题。 (比如当你 运行 使用 php cli 进行测试并且测试向你的 apache/nginx/php-fpm 发出请求时)。我为 cli 和 fpm 分配了不同的 Xdebug IDE 键,它对我有用。
我正在使用 Xdebug 调试带有 guzzle curl 调用的代码。
在任何其他代码中,Xdebug 工作正常。
但是每当有客户端调用 Guzzle 时,我得到的只是超时。
我正在使用:
- Php风暴2017.2
- Docker,带图像
richarvey/nginx-php-fpm:latest
(nginx+php fpm) - Xdebug Php 7.1
这是代码片段,它在此处冻结:
public function fetch(): string
{
$content = '';
$completePath = self::FETCH_PATH . $this->id;
$request = $this->httClient->get($completePath);
if ($request->getStatusCode() == 200) {
$content = $request->getBody()->getContents();
}
return $content;
}
我遇到了同样的问题。我相信当两个不同的 php 进程尝试使用相同的 IDE KEY 同时打开 Xdebug 连接时会出现问题。 (比如当你 运行 使用 php cli 进行测试并且测试向你的 apache/nginx/php-fpm 发出请求时)。我为 cli 和 fpm 分配了不同的 Xdebug IDE 键,它对我有用。