【发布时间】:2018-02-27 02:50:49
【问题描述】:
尝试在我的联系表单上添加 reCaptcha 时,我收到此错误:
警告:file_get_contents(): php_network_getaddresses: getaddrinfo 失败:第 79 行的 *******/MyClass.php 中的名称或服务未知
$secret = "*********************";
$response = $_POST['g-recaptcha-response'];
$remoteip = $_SERVER['REMOTE_ADDR'];
$api_url = "https://www.google.com/recaptcha/api/siteverify?secret=" . $secret. "&response=" . $response. "&remoteip=" . $remoteip ;
$decode = json_decode(file_get_contents($api_url), true);
第 79 行是“$decode = json_decode(file_get_contents($api_url), true);” 我检查了我的 php.ini,allow_url_fopen = ON。 所以..无法弄清楚出了什么问题。有什么想法吗?
【问题讨论】:
-
print_r(gethostbyname('www.google.com'));的输出是什么? -
@EduardoEscobar 这是“www.google.com”
-
@j08691Hmm 好的,所以根据您的说法,这是一个“基础设施”问题?我将与我的系统管理员分享它