curl error: couldn ' T connect to host

Ich bin versucht, curl mit proxy. Ich habe den folgenden code:

function getPage($proxy, $url, $referer, $agent, $header, $timeout) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);

$result['EXE'] = curl_exec($ch);
$result['INF'] = curl_getinfo($ch);
$result['ERR'] = curl_error($ch);

curl_close($ch);

return $result;
}

$result = getPage(
'75.125.147.82:3128', //use valid proxy
'http://www.google.com/',
'http://www.google.com/',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8',
1,
5);

if (empty($result['ERR'])) {
echo $results['EXE'];
} else {
echo $result['ERR'];
}

Die Ausgabe dieses Skripts ist 'couldn' T connect to host'

Jemand wissen, was ist falsch?

Ist das error reporting eingeschaltet? Haben Sie versucht, Anschluss an unterschiedliche host-Adressen, (nicht über proxy)?

InformationsquelleAutor geoffs3310 | 2011-02-09

Schreibe einen Kommentar