Ich versuche, diese Website zu analysieren: http://www.mz.gov.kz/ru/news, aber ich bekomme einen 504 Fehler. Nachdem ich connection_timeout
auf 60 Sek. Geändert habe, bekomme ich 28 error: connect timed out
. Auf einem anderen Server funktioniert es gut. Vielleicht war meine IP blockiert, ich weiß es nicht. Meine Funktion istcurl exec 504 timeout nginx
function get_web_page($url)
{
$uagent = "Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.14";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $uagent);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_COOKIEFILE,"d://coo.txt");
$content = curl_exec($ch);
$err = curl_errno($ch);
$errmsg = curl_error($ch);
$header = curl_getinfo($ch);
curl_close($ch);
$header['errno'] = $err;
$header['errmsg'] = $errmsg;
$header['content'] = $content;
//echo $errmsg.'s<br>';
/*foreach($header as $key=>$value){
echo $key.' -- > '.$value.'<br>';
}*/
return $header;
}