主辦我嘗試調用這個API,但有一個錯誤捲曲錯誤#:無法連接在PHP
cURL Error #:couldn't connect to host
我試試這個代碼
<?php
$url = 'http://134.255.218.101:3002/ext/getaddress/GeHSBSKg5kav6vy6neQB5XsZ29zsNRyqeb';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://134.255.218.101:3002/ext/getaddress/GeHSBSKg5kav6vy6neQB5XsZ29zsNRyqeb',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"cache-control: no-cache",
"content-type: application/json"
),
));
echo $response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
有一個與代理問題服務器...?
我如何解決在PHP
的可能的複製[如何解決捲曲錯誤(7):無法連接到主機?(https://stackoverflow.com/問題/ 9922562 /如何解決curl-error-7-couldnt-connect-to-host) – AZinkey