PHP致命错误:未捕获的GuzzleHttp \ Exception \ RequestException:cURL错误2:已在多句柄中使用的简单句柄 [英] PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 2: easy handle already used in multi handle
问题描述
我不是开发者,而是用户.开发人员不可用.
I am a user not a developer. The developer is not available.
这是Google购物产品提交脚本中使用的Google API库.
This is the Google API library used in Google Shopping Products submission scripts.
脚本每隔20分钟成功运行了2年+昨天的前5个小时.
The scripts worked successfully, every 20 minutes, for 2 years + the first 5 hours of yesterday.
然后出现以下错误:
[18-Apr-2020 06:20:03 Europe/London] PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 2: easy handle already used in multi handle (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:162
Stack trace:
#0 ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(129): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(89): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 ../vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(ThObject(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 ../vendor/guzzlehttp/guzzle/src/Handl in ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 162
在脚本停止工作时,唯一的服务器更改是应用于物理主机的安全补丁和服务器重新启动.
The only server change at around the time the scripts stopped working was a security patch applied to the physical host and a server reboot.
PHP v7.3.16
PHP v7.3.16
我相信正在使用的Google库是v2.0
I believe the Google library in use is v2.0
我可以按照说明进行操作,尽管可能不会理解它们!
I can follow instructions although will probably not understand them!
TIA
推荐答案
以防万一阅读此书的人正在使用Laravel.几天前,我们突然开始遇到相同的问题,尝试安装不同的cURL版本并设置cURL选项,但没有任何效果.我通过更改vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php文件来修复它.寻找显示以下内容的行
Just in case anyone reading this is using Laravel. We suddenly started having the same problem a few days ago, tried installing different cURL versions and setting cURL options, nothing worked. I fixed it by changing the vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php file. Look for the line that says
if (count($this->handles) >= $this->maxHandles) {
curl_close($resource);
} else {
...
}
全部注释掉,而不是if/else
Comment this all out, and instead of the if/else just write
curl_close($resource);
换句话说,无论句柄计数是多少,您始终关闭cURL连接.这立即为我们工作了!
In other words no matter what the handles count is you always close the cURL connection. This worked instantly for us!
希望它会有所帮助:)
这篇关于PHP致命错误:未捕获的GuzzleHttp \ Exception \ RequestException:cURL错误2:已在多句柄中使用的简单句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!