I’ve been working at getting some long-standing bugs out of my weather website www.waltersfalls.ca. One issue I can’t get fixed is the radar on the home page. It used to work, but has not for quite some time now, and I cannot find any settings that have changed or are incorrect. Can anyone get me pointed in the right direction?
It seems there’s a problem loading the radar images – doing a wxradar.php?cache=no and a view-source shows
<!-- Loading http://weatheroffice.gc.ca/radar/image.php?base=/data/radar/temp_image/WKR/WKR_PRECIP_RAIN_2011_07_13_15_30.GIF&overlays[]=/radar/images/layers/rivers/wkr_rivers.gif&overlays[]=/radar/images/layers/roads/WKR_roads.gif&overlays[]=/radar/images/layers/additional_cities/wkr_towns.gif&overlays[]=/radar/images/layers/default_cities/wkr_towns.gif
to radar-WKR-0.png
dir=/home/walter12/public_html/radar/ -->
<!-- unable to reload radar-WKR-0.png (0.000 secs.) -->
...
You are running V1.07 of the script (current is V1.08), but I’m not sure that can fix the issue.
The message
comes from the results of the download_file routine
function download_file($file_source,$file_dir, $file_target) {
// do a binary download and save to disk file locally
$rh = fopen($file_source, 'rb');
$wh = fopen($file_dir . $file_target, 'wb');
if ($rh===false || $wh===false) {
// error reading or opening file
return false;
}
since the other cache files in the directory seem to be writable, I suspect that your PHP is disallowing the opening of an URL.
Try adding to your php.ini file in your document root
allow_url_fopen = on;
and see if that fixes the error. If your website recently updated to PHP5, the default setting for that was ‘off’, and this new setting will make it like it was in PHP4.
OK, thanks for the reply. However, why can’t I find a php.ini file in my root folder? The root folder should be the /public_html where the clientraw.txt, common.php, settings.php, etc. are, correct?
If the php.ini is missing, then just create one with notepad with
allow_url_fopen = on;
in it, then upload to your document root. … Yes, it’s the same folder where all the files you listed reside
I remember what V1.08 of the script does… it checks for that specific error and posts a message about it and has improved image parsing code. I suggest you update the script to V1.08 from http://saratoga-weather.org/scripts-ECradar.php