Php cURL:无法解析主机:xx.com[ping xx.com正常,xx.com是我的本地域]

Php cURL:无法解析主机:xx.com[ping xx.com正常,xx.com是我的本地域],php,curl,dns,Php,Curl,Dns,然后运行php代码,演示: 有时show无法解析主机:xx.com 有时显示正确的数据 我试着去解决它,我用谷歌搜索它,但不工作。所以我在这里请求帮助 ping xx.com ok 我的决议: nameserver 8.8.8.8 名称服务器114.114.114.114 myhosts: /etc/主机: xx.com 127.0.0.1 谁能帮我,Tks 你想卷曲什么?您可能被阻止了,或者您试图卷曲的URL限制了您可以访问他们的服务。xx.com是我的本地域,没有限制 function c

然后运行php代码,演示:

有时show
无法解析主机:xx.com

有时显示正确的数据

我试着去解决它,我用谷歌搜索它,但不工作。所以我在这里请求帮助

ping xx.com ok

我的决议:

nameserver 8.8.8.8
名称服务器114.114.114.114

myhosts:

/etc/主机:
xx.com 127.0.0.1


谁能帮我,Tks

你想卷曲什么?您可能被阻止了,或者您试图卷曲的URL限制了您可以访问他们的服务。xx.com是我的本地域,没有限制
function curl_upload($post_url, $post_data) {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $post_url);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0");
    $result = curl_exec($curl);
    $error = curl_error($curl);
    curl_close($curl);
    return $error ? $error : $result;
}

$data = curl_upload('http://xx.com/lists', $condition);
echo $data;exit();