i have a script that i was using before i installed amp that pings a server and displays a specified image depending on whether the ping is successful or not.
here is the code:
- Code: Select all
<?php
$server = "bst82551.ath.cx";
$port = "8080";
#Timeout in seconds before displaying the offline message.
$tout = "3";
header("Content-type: image/jpeg");
$ftping = @fsockopen ($server, $port, $errno, $errstr, $tout);
if (!$ftping) {
readfile('images/camoff.jpg');
} else {
readfile('http://bst82551.ath.cx:8080/cam_1.jpg');
}
?>
it runs much slower than it did on my previous installation. before, i had apache 2.052 and php 5 installed. That was it, just apache and php. Is there something that i should do so that this script will run faster? Is there some extra error checking occuring?
Brian