Greetings,
I am having problems with the following code:
<?php
$WebFile = "http://bible.gospelcom.net/bible?version=KJV&passage=2SAM+11:14-27";
$fd = fopen ($WebFile, "r");
if ($fd) {
echo "Success";
} else {
echo "Failed";
}
fclose($fd);
?>
I'm using RedHat Linux 7
Apache 1.3.19
PHP 4.0.4pl1
This system sits behind a firewall. When I allow it out, the above script works just fine, however, when I block it, it does not work, it appears to just keep processing. I'm blocking to simulate an outage, as they happen periodically due to weather and such, normally it will not be blocked.
Is there a timeout of some kind that can be set to stop this from continually trying to get the page? It takes several minutes before it stops and the browser returns an error. I'd like this function to return false as quickly as possible so that my code and handle it and return the page as quickly as possible.
Thanks
Daniel