Welcome to the Cumulus Support forum.
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
Saratoga Base-* Templates and PHP 8
Moderator: saratogaWX
- saratogaWX
- Posts: 1198
- Joined: Wed 06 May 2009 5:02 am
- Weather Station: Davis Vantage Pro Plus
- Operating System: Windows 10 Professional
- Location: Saratoga, CA, USA
- Contact:
Saratoga Base-* Templates and PHP 8
I've done testing with the Base-Canada, Base-USA and Base-World templates and only found two scripts that needed minor updates to run on PHP 8.+ (and still compatible with older PHP versions).
common.php V1.11 and flyout-menu.php V1.09 are now available using the update tool with a query of Base-*, Plugin-* 07-Dec-2020
The remaining support scripts seem to work fine and not cast errata in the error_log. It's safe to update before you update PHP to 8.0.0 as the fixes were backward compatible to prior PHP5/PHP7.
common.php V1.11 and flyout-menu.php V1.09 are now available using the update tool with a query of Base-*, Plugin-* 07-Dec-2020
The remaining support scripts seem to work fine and not cast errata in the error_log. It's safe to update before you update PHP to 8.0.0 as the fixes were backward compatible to prior PHP5/PHP7.
- PaulMy
- Posts: 3849
- Joined: Sun 28 Sep 2008 11:54 pm
- Weather Station: Davis VP2 Plus 24-Hour FARS
- Operating System: Windows8 and Windows10
- Location: Komoka, ON Canada
- Contact:
Re: Saratoga Base-* Templates and PHP 8
Thanks Ken,
I am all up to date again with scripts for www.komokaweather.com/komokaweather-ca
PHP 7.4 is the latest available on the GoDaddy list so will be a while before I will look at PHP 8.
Enjoy,
Paul
I am all up to date again with scripts for www.komokaweather.com/komokaweather-ca
PHP 7.4 is the latest available on the GoDaddy list so will be a while before I will look at PHP 8.
Enjoy,
Paul
VP2+
C1 www.komokaweather.com/komokaweather-ca
MX https://komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX https://komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX https:// komokaweather.com/cumulusmx4/index.htm
C1 www.komokaweather.com/komokaweather-ca
MX https://komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX https://komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX https:// komokaweather.com/cumulusmx4/index.htm
- ConligWX
- Posts: 1632
- Joined: Mon 19 May 2014 10:45 pm
- Weather Station: Davis vPro2+ w/DFARS + AirLink
- Operating System: Ubuntu 22.04 LTS
- Location: Bangor, NI
- Contact:
Re: Saratoga Base-* Templates and PHP 8
Ken to the rescue again. Thank you.
Regards Simon
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
- N0BGS
- Posts: 205
- Joined: Sat 10 Nov 2012 2:26 am
- Weather Station: Davis Vantage Pro 2
- Operating System: Win10vm,VMWare ESXi 7.0
- Location: Hermon, Maine USA
- Contact:
Re: Saratoga Base-* Templates and PHP 8
Meanwhile, one year later....
I just updated my Linux server to Fedora 35 today which also updated PHP to version 8.0.13. After doing so my home page would no longer display the forecast and wxforecast.php was also blank.
After investigating this a bit I found that the error was caused by a typo on line 537 of advforecast2.php:
Obviously that should be "json_last_error" not "jason." Why PHP 7.x didn't care about that I don't know.
This seems like an error I may have caused myself rather than Ken since he doesn't make errors, but if it was me I don't remember doing it.
So if you're having a similar problem you may want to check that line.
--Kurt
www.kpw3.com
I just updated my Linux server to Fedora 35 today which also updated PHP to version 8.0.13. After doing so my home page would no longer display the forecast and wxforecast.php was also blank.
After investigating this a bit I found that the error was caused by a typo on line 537 of advforecast2.php:
Code: Select all
$Status.= "<!-- JSON decode $JSONerror -->\n";
if (jason_last_error() !== JSON_ERROR_NONE) {
$Status.= "<!-- content='" . print_r($content, true) . "' -->\n";
}
This seems like an error I may have caused myself rather than Ken since he doesn't make errors, but if it was me I don't remember doing it.
So if you're having a similar problem you may want to check that line.
--Kurt
www.kpw3.com
Blitzortung Station 1809
-
- Posts: 1256
- Joined: Mon 09 Jul 2012 8:40 pm
- Weather Station: Davis VP2 Cabled
- Operating System: Windows 10 Pro
- Location: Auckland, New Zealand
- Contact:
Re: Saratoga Base-* Templates and PHP 8
OK, have made the changes to both files.
Using World and Cumulus files.
However now have an error in PHP 7.4.26 ( and earlier) and PHP 8.1
Undefined variable $string in common.php @ line 502
Have 2 different issues with PHP8
1:-
Deprecated:
Implicit conversion from float4.3111111111111 to int loses precision in CU-defs.php on line 1006
This is here
$dir = $windlabel[ fmod((($winddir + 11) / 22.5),16) ];
the CUdefs file
#-------------------------------------------------------------------------------------
# CU support function - CU_deg2dir - Convert wind direction degrees to cardinal name
#-------------------------------------------------------------------------------------
2:-
Also the same Deprecated error but in these lines (in a non Saratoga template addon file for current conditions.
Any assistance correcting these issues would be appreciated.
NOTE:- our public websites are still running PHP7 and does not have these updates yet.
Thanks
Using World and Cumulus files.
However now have an error in PHP 7.4.26 ( and earlier) and PHP 8.1
Undefined variable $string in common.php @ line 502
Code: Select all
<img src="'. $SITE['imagesDir'] . 'flag-'. $k .'.gif" alt="'. $v .'" title="'. $v .'" style="border: none;" /></a>
1:-
Deprecated:
Implicit conversion from float4.3111111111111 to int loses precision in CU-defs.php on line 1006
This is here
$dir = $windlabel[ fmod((($winddir + 11) / 22.5),16) ];
the CUdefs file
#-------------------------------------------------------------------------------------
# CU support function - CU_deg2dir - Convert wind direction degrees to cardinal name
#-------------------------------------------------------------------------------------
Code: Select all
function CU_deg2dir ($degrees) {
// figure out a text value for compass direction
// Given the wind direction, return the text label
// for that value. 16 point compass
$winddir = $degrees;
if ($winddir == "n/a") { return($winddir); }
if (!isset($winddir)) {
return "---";
}
if (!is_numeric($winddir)) {
return($winddir);
}
$windlabel = array ("N","NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S",
"SSW","SW", "WSW", "W", "WNW", "NW", "NNW");
$dir = $windlabel[ fmod((($winddir + 11) / 22.5),16) ];
return($dir);
} // end function CU_deg2dir
Also the same Deprecated error but in these lines (in a non Saratoga template addon file for current conditions.
Code: Select all
$auto .= $langWindShort[ round(($RT_avgbearing +11) / 22.5 % 16)];
$hybrid .= $langWindShort[ round(($RT_avgbearing +11) / 22.5 % 16)];
NOTE:- our public websites are still running PHP7 and does not have these updates yet.
Thanks
- saratogaWX
- Posts: 1198
- Joined: Wed 06 May 2009 5:02 am
- Weather Station: Davis Vantage Pro Plus
- Operating System: Windows 10 Professional
- Location: Saratoga, CA, USA
- Contact:
Re: Saratoga Base-* Templates and PHP 8
For common.php lne 502 change it to
For the CU-defs.php, try
and see if that fixes the deprecated error.
For the non-saratoga scripts, try
Code: Select all
$string1 = ''; $string = '';
Code: Select all
$dir = $windlabel[ (integer)round(fmod((($winddir + 11) / 22.5),16),0) ];
For the non-saratoga scripts, try
Code: Select all
$auto .= $langWindShort[ (integer)round(($RT_avgbearing +11) / 22.5 % 16)];
$hybrid .= $langWindShort[ (integer)round(($RT_avgbearing +11) / 22.5 % 16)];
-
- Posts: 1256
- Joined: Mon 09 Jul 2012 8:40 pm
- Weather Station: Davis VP2 Cabled
- Operating System: Windows 10 Pro
- Location: Auckland, New Zealand
- Contact:
Re: Saratoga Base-* Templates and PHP 8
OK
@ Line 495 changed
$string1 = '';
to
$string = '';
== success for both php 7 and 8.
Also success with change to CU-defs.php for php 7 and 8
However no joy with change to
$auto .= $langWindShort[ (integer)round(($RT_avgbearing +11) / 22.5 % 16)];
$hybrid .= $langWindShort[ (integer)round(($RT_avgbearing +11) / 22.5 % 16)]; }
which reports the same error in php 8 but OK in php 7
Thanks
@ Line 495 changed
$string1 = '';
to
$string = '';
== success for both php 7 and 8.
Also success with change to CU-defs.php for php 7 and 8
However no joy with change to
$auto .= $langWindShort[ (integer)round(($RT_avgbearing +11) / 22.5 % 16)];
$hybrid .= $langWindShort[ (integer)round(($RT_avgbearing +11) / 22.5 % 16)]; }
which reports the same error in php 8 but OK in php 7
Thanks
- saratogaWX
- Posts: 1198
- Joined: Wed 06 May 2009 5:02 am
- Weather Station: Davis Vantage Pro Plus
- Operating System: Windows 10 Professional
- Location: Saratoga, CA, USA
- Contact:
Re: Saratoga Base-* Templates and PHP 8
So, try my same hack with the non-saratoga scripts:
Glad the other ones worked out
PHP 8 seems to be more fussed about typing of variables. The round() returns a float value, so (integer)round() makes it an integer for the index in to the wind direction array.
PHP 7 seemed to do the typing-to-integer automatically, PHP 8 insists on having it match the integer index.
Code: Select all
$auto .= $langWindShort[ (integer)round(fmod((($RT_avgbearing + 11) / 22.5),16),0)];
$hybrid .= $langWindShort[ (integer)round(fmod((($RT_avgbearing + 11) / 22.5),16),0)];
PHP 8 seems to be more fussed about typing of variables. The round() returns a float value, so (integer)round() makes it an integer for the index in to the wind direction array.
PHP 7 seemed to do the typing-to-integer automatically, PHP 8 insists on having it match the integer index.
-
- Posts: 1256
- Joined: Mon 09 Jul 2012 8:40 pm
- Weather Station: Davis VP2 Cabled
- Operating System: Windows 10 Pro
- Location: Auckland, New Zealand
- Contact:
Re: Saratoga Base-* Templates and PHP 8
Well, That seems to have sorted it.
Thanks V much.
However,
there is ? (was ?) an error with the CU-defs.php fix in php 7. Not sure about php 8 as it is a fleeting value depending on wind direction.
Undefined offset: 16 in CU-defs.php on line 1007
It seems only to occur when the value is 16 - have not seen it on any other value (yet).
Thanks V much.
However,
there is ? (was ?) an error with the CU-defs.php fix in php 7. Not sure about php 8 as it is a fleeting value depending on wind direction.
Undefined offset: 16 in CU-defs.php on line 1007
It seems only to occur when the value is 16 - have not seen it on any other value (yet).
- saratogaWX
- Posts: 1198
- Joined: Wed 06 May 2009 5:02 am
- Weather Station: Davis Vantage Pro Plus
- Operating System: Windows 10 Professional
- Location: Saratoga, CA, USA
- Contact:
Re: Saratoga Base-* Templates and PHP 8
So maybe the 'round' wasn't such a good idea.
Try
and
then the array selector value will be 0..15 which matches the array size of 16 elements.
Try
Code: Select all
$dir = $windlabel[ (integer)fmod((($winddir + 11) / 22.5),16) ];
Code: Select all
$auto .= $langWindShort[ (integer)fmod((($RT_avgbearing + 11) / 22.5),16)];
$hybrid .= $langWindShort[ (integer)fmod((($RT_avgbearing + 11) / 22.5),16)];
-
- Posts: 1256
- Joined: Mon 09 Jul 2012 8:40 pm
- Weather Station: Davis VP2 Cabled
- Operating System: Windows 10 Pro
- Location: Auckland, New Zealand
- Contact:
Re: Saratoga Base-* Templates and PHP 8
Thanks,
Will let it run for a while and report the outcome in due course.
Will let it run for a while and report the outcome in due course.
- mcrossley
- Posts: 12770
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Saratoga Base-* Templates and PHP 8
Actually, I think PHP 8 still does, it is only a deprecation notice not an error. The change will come in PHP 9?saratogaWX wrote: ↑Sat 04 Dec 2021 12:53 am PHP 7 seemed to do the typing-to-integer automatically, PHP 8 insists on having it match the integer index.
-
- Posts: 1256
- Joined: Mon 09 Jul 2012 8:40 pm
- Weather Station: Davis VP2 Cabled
- Operating System: Windows 10 Pro
- Location: Auckland, New Zealand
- Contact:
Re: Saratoga Base-* Templates and PHP 8
Well, the deprecation warnings were up AND the relevant code was not executed.
- mcrossley
- Posts: 12770
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Saratoga Base-* Templates and PHP 8
Hmm, I stand corrected then. But deprecation warnings are normally just that. A warning that something will stop working in a future release, otherwise it is an error.
-
- Posts: 1256
- Joined: Mon 09 Jul 2012 8:40 pm
- Weather Station: Davis VP2 Cabled
- Operating System: Windows 10 Pro
- Location: Auckland, New Zealand
- Contact:
Re: Saratoga Base-* Templates and PHP 8
@ Mark
You may be correct (partially?) as some things were definitely not working.
The page was some what unreadable with multiple deprecation notices all over the place for different errors despite error notification being turned off.
Have found other issues with php 8.1.0 that do not occur with 8.0.13
It seems 8.1.0 has introduced numerous additional changes.
You may be correct (partially?) as some things were definitely not working.
The page was some what unreadable with multiple deprecation notices all over the place for different errors despite error notification being turned off.
Have found other issues with php 8.1.0 that do not occur with 8.0.13
It seems 8.1.0 has introduced numerous additional changes.