[英]Failed to connect to graph.facebook.com port 443: Connection refused
[英]CURL: Failed to connect to exampleurl.com port 443: Connection refused
每当我尝试通过CURL(PHP)连接API时,邮递员都会成功响应,但会出现“无法连接到exampleurl.com端口443:连接被拒绝”错误。 代码正在开发服务器中运行。
这是我的卷曲代码
$ch = curl_init();
$headers = array(
"Authorization: $this->header_token" // my token
);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$res = curl_exec($ch);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if(curl_error($ch))
{
echo 'error:' . curl_error($ch); //giving error
}
curl_close($ch);
if($http_status == 200){
return json_decode($res,true);
}
一件事,我最近收到此错误,以前它可以正常工作,完全没有问题。 任何建议或解决方案,请帮助。
添加此选项我遇到了同样的问题,然后解决了
curl_setopt( $ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.