Posted by:
nbakewell
(---.ntc.harrisonburg.shentel.net)
Hey,
I am trying to run a piece of code on my machine with WAMP that I had running on my server, but I am now getting an error. I am guessing that I have to change some setting, but I don't know which one or where to find it. Here is the error:
Warning: fsockopen() [function.fsockopen]: unable to connect to [
google.com] (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in C:\www\www\Snippets\systest.php on line 40
And my code is:
function pingDomain($domain){
$starttime = microtime(true);
$file = fsockopen ($domain, 80, $errno, $errstr, 10);
$stoptime = microtime(true);
$status = 0;
if (!$file) $status = -1; // Site is down
else {
fclose($file);
$status = ($stoptime - $starttime) * 1000;
$status = floor($status);
}
return $status;
}
Any ideas? Thanks!