WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: zmarfak on February 18, 2022, 07:27:43 AM

Title: Regional Mesonet map Saratoga Template.
Post by: zmarfak on February 18, 2022, 07:27:43 AM
Hi,
I updated the mesonet files a while ago when Ken corrected them for PHP 8.1.
Now I see that my regional mesonet map is not working.
There is no problem with my global map.

Has anyone has a clue what to search for ?

regional map : https://www.matar.be/weather/wxmesonetmap.php (https://www.matar.be/weather/wxmesonetmap.php)
global map : https://www.matar.be/weather/wxglobal.php (https://www.matar.be/weather/wxglobal.php)

PHP version used  : 8.0.15

Thanks

PS
when I run  wxmesonetmap.php on my local computer I have following messages ( I don't know if it is related ) (running : IIS  Manager)
Code: [Select]
PHP Fatal error:  Uncaught Error: Call to undefined function locale_get_default() in D:\data\matar\weather\mesonet-map-common.php:921
Stack trace:
#0 D:\data\matar\weather\mesonet-map-genhtml-inc.php(200): new_strftime()
#1 D:\data\matar\weather\mesonet-map-inc.php(168): include_once('...')
#2 D:\data\matar\weather\wxmesonetmap.php(75): include_once('...')
#3 {main}
  thrown in D:\data\matar\weather\mesonet-map-common.php on line 921
Title: Re: Regional Mesonet map Saratoga Template.
Post by: zmarfak on February 19, 2022, 03:36:22 AM
Guys,
forget this post.
Maybe there  was  a  hiccup with connections  ? Who knows  ? Anyway everything seems ok now

Title: Re: Regional Mesonet map Saratoga Template.
Post by: zmarfak on September 01, 2022, 02:32:42 AM
Hi,
I have again problems with my regional map, global map works fine.
I get following error in the "proxy error log"
Code: [Select]
2022/09/01 08:24:11 [error] 1616#0: *112911375 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type ?int, string given in /var/www/vhosts/matar.be/httpdocs/weather/mesonet-map-common.php:525
Stack trace:
#0 /var/www/vhosts/matar.be/httpdocs/weather/mesonet-map-common.php(525): date()
#1 /var/www/vhosts/matar.be/httpdocs/weather/mesonet-map-json.php(175): RMNET_convertUnits()
#2 /var/www/vhosts/matar.be/httpdocs/weather/mesonet-map-json.php(124): RMNET_make_JSON()
#3 {main}
  thrown in /var/www/vhosts/matar.be/httpdocs/weather/mesonet-map-common.php on line 525" while reading upstream, client: 91.177.27.214, server: matar.be, request: "GET /weather/mesonet-map-json.php HTTP/2.0", upstream: "fastcgi://unix:///var/www/vhosts/system/matar.be/php-fpm.sock:", host: "www.matar.be", referrer: "https://www.matar.be/weather/wxmesonetmap.php"

regional display (not ok):
https://www.matar.be/weather/wxmesonetmap.php (https://www.matar.be/weather/wxmesonetmap.php)

global display (ok) :
https://www.matar.be/weather/wxglobal.php

Anyone has an idea how to solve this ?
Thanks
Title: Re: Regional Mesonet map Saratoga Template.
Post by: Jasiu on September 01, 2022, 08:31:08 AM
Ken posted changes yesterday. Maybe that's related?
Title: Re: Regional Mesonet map Saratoga Template.
Post by: saratogaWX on September 01, 2022, 11:37:24 AM
No, that's a different problem caused by malformed JSON from mesonet-map-json.php for the BNLWN network.  It's missing some stuff at the end of the JSON file, so it results in a JavaScript error on the display and the date() error shown above. 

It was caused by a bad entry at the end of the BNLWN-conditions.txt file
Quote
Netherlands   Schoonebeek   118|,,,,,,,,,,,,,,1662046339,0.141
which was missing all the needed data.

I've updated the mesonet-map-json.php to V4.09 to reject that.. try the attached.

edit: added the script to the distribution of mesonet-map.zip so the mesonet-map-check-versions.php utility will also note the update.
Title: Re: Regional Mesonet map Saratoga Template.
Post by: zmarfak on September 01, 2022, 02:23:08 PM
Ken,
Thank you (again) for the solution.
Just installed it and it's ok. [tup]
Title: Re: Regional Mesonet map Saratoga Template.
Post by: rrrick8 on September 02, 2022, 09:08:34 AM
As a side, whenever I come to this thread I get a Malwarebytes Blocked pop-up notice about your website zmarfak.
Don't know history or if you are aware of it. As one who had to fight Google incorrectly labeling my website as malicious a couple years ago, it can be a pain to correct.
Just wanted to let you know.

Rick
 [ You are not allowed to view attachments ]