gpt4 book ai didi

http - Zend_Http_Client 超时

转载 作者:可可西里 更新时间:2023-11-01 16:38:53 27 4
gpt4 key购买 nike

嘿,我正在使用 Zend_Http_Client 调用服务器中的 php 服务,但我遇到了与超时相关的异常:

2012-05-30T13:47:26+02:00 INFO(6): LeomobileMdcms: Requesting callback url  (http://######.nurago.com/mobileRedirect.php?resp=NRGH&annotations=) while updating  (356812045426135) of device with token (BtPhP), in    LeomobileMdcms_UserInformationController::registerdeviceAction

2012-05-30T13:47:41+02:00 ERR(3): LeomobileMdcms: Exception throwed: Unable to Connect to tcp://########.nurago.com:80. Error #110: Connection timed out, in LeomobileMdcms_UserInformationController::registerdeviceAction

这段代码负责调用回调 URL:

$client = new Zend_Http_Client($receivedSmsUrl);
$client->setConfig(array("timeout"=>5));
try {
$this->log("Requesting callback url ($receivedSmsUrl) while updating "
."IMEI ($address) of device with token ($token), in ".__METHOD__,
Zend_Log::INFO);
$response = $client->request();
if ($response->isError()) {
$this->log("Request failed. Server reply: ".$response->getStatus()
." ".$response->getMessage(),
Zend_Log::WARN);
}
} catch(Zend_Http_Client_Exception $e) {
$this->log("Exception throwed: ".$e->getMessage().", in ".__METHOD__,
Zend_Log::ERR);
}

我原以为是防火墙问题,但不幸的是它与防火墙无关。

有人可以帮忙吗?

最佳答案

将您的适配器从 Socket(默认)更改为 Curl。这应该可以解决问题:

$client = new Zend_Http_Client();
$client->setAdapter('Zend_Http_Client_Adapter_Curl');

关于http - Zend_Http_Client 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10817821/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com