我正在尝试在我的网站上验证Google Recaptcha(我正在使用Godaddy Server(CPANEL((。但是,当我尝试验证服务器端时,它需要太长,然后我有时间。
任何人都可以指出是什么原因引起了问题?
if(isset($this->data['g-recaptcha-response']) && !empty($this->data['g-recaptcha-response'])){
$u = "https://www.google.com/recaptcha/api/siteverify?secret=".DataSecret."&response=".$this->data['g-recaptcha-response']."&remoteip=".$_SERVER['REMOTE_ADDR'];
$response = @file_get_contents($u);
$arr = json_decode($response,true);
}
我收到此错误消息:
警告(2(:file_get_contents(https://www.google.com/recaptcha/api/siteverify?secret= {xxxxxxxxxxx}:未能打开流:连接时间
注意:在本地主机上(在同一服务器上(,file_get_contents
正在工作。我只是对recaptcha有问题。
@yogesh saroya, 您是否在服务器设置中检查了allow_url_fopen=On
,allow_url_include=On
?我认为需要这两个设置。