Recently I got my WXSIM version customized by Tom and I wanted to use the EWN-style WXSIM-forecast scripts downloaded from NordicWeather (from 03-2017).
I am running my website on a Synology NAS with an old PHP5.3 version.
The WXSIM saratoga and Leuven scripts needed only configuration but to get the EWN-style scripts finally running I had to do the following:
-
debug with browser URL …/wxsim-ewn/wxsim/_test.php?wunit=kmh&lang=en&test
-
to be able to read the lastret.txt file I had to use an absolute path in config.php:
$path_to_lastret = “http://leonas.ddns.net/Wetterstation.Suttenbrunn.CumulusMX/lastret.txt”;
the relative path #path_to_lastret = “…/lastret.txt”; did not work
although for the rest of the paths I could use relative path names:
$path_to_langfiles = “./wxsim/”;
$path_to_dataphp = “./wxsim/”;
$path_to_js = “./js/”;
$path_to_css = “./css/”; -
on the other hand to avoid a display of 01.01.1970 I had to use an relative path in script frc.php:
‘.UPDATED.’: ‘.date($timeFormat,filemtime(“…/lastret.txt”)).’ -
to display a correct “next Update” I adapted the following line in frc.php:
$thishr = date(‘H’); (replacing ‘i’ by ‘H’) -
and finally I had to adapt the sunmoon.php script to run under PHP5.3:
a) replacing brackets by array () in some locations and
b) harcoding the timezone in
function fromJulian($j) {
if (!is_nan($j))
{
$dt = new DateTime(“@”.round(($j + 0.5 - J1970) * daySec));
$dt->setTimezone(new DateTimeZone(‘Europe/Amsterdam’));
return $dt;
}
}
Now the EWN-style interpretation of my WXSIM forecast is working fine under URL:
http://leonas.ddns.net/Wetterstation.Suttenbrunn.CumulusMX/wxsim-ewn/forecast.php
If somebody is interested I could upload/attach the modified php scripts.
regards
leo