I'm checking fsockopen
in Ubuntu server 13.04 with this code:
<?php
$fp = fsockopen("www.google.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />
";
} else {
$out = "GET / HTTP/1.1
";
$out .= "Host: www.example.com
";
$out .= "Connection: Close
";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
and the server returning
php_network_getaddresses: getaddrinfo failed: System error (0)
Any help with this?