I’m just trying to update to PHP8 and came across this error.
Fatal error: Uncaught TypeError: round(): Argument #1 ($num) must be of type int|float, string given in /home/loganvil/public_html/wsfct4/wsIncWxsimPCreate.php:207 Stack trace: #0 /home/loganvil/public_html/wsfct4/wsIncWxsimPCreate.php(207): round(‘’) #1 /home/loganvil/public_html/wsfct4/wsIncWxsimPHtml4.php(85): include_once(‘/home/loganvil/…’) #2 /home/loganvil/public_html/wsfct4/wsFctWxsimDPage.php(270): include_once(‘/home/loganvil/…’) #3 {main} thrown in /home/loganvil/public_html/wsfct4/wsIncWxsimPCreate.php on line 207
When I change back to PHP7.4 on my website, it works as expected.
Anyone come across this and know what the fix it ?
Without seeing the actual code it is difficult to know. What I would say is that PHP 8 does change quite a lot of stuff which causes errors in older code written for earlier releases. Who is the author of said PHP code? Could they help? The error says it is a rounding error where the variable is not an integer or float number but a string.
I downloaded an older version of the scripts a while ago and started to experiment with them on my web site, but as usual my own web site comes last to be worked on after the forum, WxSim, etc and I didn’t complete my testing. I went back to try to download a newer version just recently and found on the download page
Sorry for the inconvenience. No downloads possible. Sites are closing down
which gave the impression that you’d stopped supporting them. I did follow the link to the support page but that only references PWS Dashboard which again gave the impression that you were no longer supporting the forecast scripts.
Can you please clarify the situation. You provide support for existing users who have made a donation in the past but there is now no way to join the list of ‘supporting users’ because the scripts can’t be downloaded for testing by new users?
Note: I’m not having a go at you about this…I just want to know whether I (and others in future) have missed the boat to use the scripts? If that’s your decision then I respect it. It’s your software to do with as you wish. At least if I know that then I can look around for some other software that I can use instead.
I try to explain my ideas about supporting these old scripts.
EndOfLife =>
The contents of the Leuven forecast scripts V4 package is becoming smaller and smaller.
Multiple forecast companies dropped the API’s or changed them heavily in the past. For example: NOAA, YR.no, WeatherUnderground in the past years and March 31 DarkSky
NWS/NOAA SOAP becomes often less stable for days.
The design of the scripts is “not up-to-date” to say the least.
There are good alternatives f.i. EWN has multiple more modern looking general forecast and also two WXSIM forecasts.
Support => continuous support for existing users / sponsors
They invested their time to implement and install the scripts in their website a long time ago. Does not cost that much time from me to help if there is a problem with PHP
In the first releases up to ten years ago, new users needed one good forecast and integrated that on their website.
They spent a lot of time to build their website and were willing to study the readme and follow the instructions.
The quality, readme files a.s.o. of the old scripts compares bad with the app-experience younger users have.
Nowadays one wants / uses multiple different forecasts, just for the fun of it.
One does not read the documentation, one asks questions over and over again, one expects scripts to run “out-of-the-box” and there should be a graphical install procedure.
New users: Supporting new users with these old scripts cost more support time which often is not available.
My conclusions:
I feel obliged to users who supported in the past.
I will not enhance or write new scripts. Only adept the current scripts with the current API’s for future PHP-changes.
I don’t want any obligations to unknown “maybe i will use your product but . . .” users
And to really write a new set of forecasts with “modern” app-type setup instructions, would cost far too much time.
Downloads:
They are available again by pressing the button. Support will be sparse.
Just downloaded the Leuven v4.11 forecast scripts 2022-03-27 PHP 8.1.1 scripts and loaded them onto my system. Did a little customizing and they displayed correctly. I then updated wsFctWxsimDPage.php by changing $your_settings from ‘_metric_settings.php’ to ‘_us_settings.php’. I uploaded this file then again tested wsFctWxsimDPage.php. This time, instead of the graph at the top of the page, there is now a message where the graph should be “here the graph will be drawn”. If I change $your_settings back to ‘metric’, the graph displays again. If I go back to the ‘us’ setting, I get the error message again. I’m using the original copy of '_us_settings.php without any changes. Any idea what’s going on? The URL is wxsimD weather forecast. Thanks.
First thought:
This is not a PHP8.x problem.
It is caused by a new improved release 11.0.0 on November 26 of the dynamically loaded Highcharts graphing javascripts
A temporary answer is found in the support topic for Leuven scripts
I will update and test the scripts a.s.a.p. and publish the new zip.
Second thought:
The WXSIM scripts are already compliant with release Highcharts 11.0.0
Your problem is in the settings.
Please test the tabs below the graph
Only tab “Forecast” is OK
Tab icons has unrealistic temperatures 138.2° and wind-speeds 7.4565 mph
The two forecast tabs are empty.
Thanks very much for the information. As you pointed out, the problem was the latest.csv. I actually upload my “good” latest.csv to a folder called wxsimcsv. I made that update in my script to point to that folder for latest.csv and that fixed my issue.