Page 2 of 4
Re: meteotemplate php 8.0/8.1
Posted: Sat Oct 15, 2022 5:20 pm
by Gerrit
@Gerrit
I think you still have the original climateIndices.php file try substituting with the attached one ( uncompress it in the pages/station directory )
Unfortunately still problems, could it be that I am overlooking more files?
https://www.waskolkweer.nl/meteotemplat ... ndices.php
Re: meteotemplate php 8.0/8.1
Posted: Sat Oct 15, 2022 5:54 pm
by spd2612
@Gerrit
I upgraded PHP to 8.1.11 as I was having a log issue with 8.0 and I have the same issue with two pages
https://hurricanepub.com/pages/forecast/index.php
Deprecated: Function date_sunrise() is deprecated in E:\hurricanepub\header.php on line 141 Deprecated: Function date_sunset() is deprecated in E:\hurricanepub\header.php on line 142 Deprecated: Implicit conversion from float 2551442.8610880002 to int loses precision in E:\hurricanepub\scripts\functions.php on line 1218 Deprecated: Implicit conversion from float 2551442.8610880002 to int loses precision in E:\hurricanepub\scripts\functions.php on line 1218 Deprecated: Function date_sunrise() is deprecated in E:\hurricanepub\header.php on line 313 Deprecated: Function date_sunset() is deprecated in E:\hurricanepub\header.php on line 314 Warning: file_get_contents(
https://api.openweathermap.org/data/2.5 ... cab1cf11d5): Failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in E:\hurricanepub\pages\forecast\index.php on line 77 Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in E:\hurricanepub\pages\forecast\index.php:109 Stack trace: #0 {main} thrown in E:\hurricanepub\pages\forecast\index.php on line 109
I am still getting this error 3 days after changing the key What am I missing
Code: Select all
{"cod":401, "message": "Invalid API key. Please see https://openweathermap.org/faq#error401 for more info."}
https://hurricanepub.com/pages/station/ ... ndices.php
Deprecated: Function date_sunrise() is deprecated in E:\hurricanepub\header.php on line 141 Deprecated: Function date_sunset() is deprecated in E:\hurricanepub\header.php on line 142 Deprecated: Implicit conversion from float 2551442.8610880002 to int loses precision in E:\hurricanepub\scripts\functions.php on line 1218 Deprecated: Implicit conversion from float 2551442.8610880002 to int loses precision in E:\hurricanepub\scripts\functions.php on line 1218 Deprecated: Function date_sunrise() is deprecated in E:\hurricanepub\header.php on line 313 Deprecated: Function date_sunset() is deprecated in E:\hurricanepub\header.php on line 314 Fatal error: Uncaught Error: Call to a member function format() on bool in E:\hurricanepub\pages\station\climateIndices.php:338 Stack trace: #0 {main} thrown in E:\hurricanepub\pages\station\climateIndices.php on line 338
I have changed the api key in main setup
Re: meteotemplate php 8.0/8.1
Posted: Sun Oct 16, 2022 7:17 pm
by andyk1
It fixed it somewhat for me once I remembered to also change to openweathers api key which I did/Have and changed in Main Setup and then hit the refresh cache at the lower right of the of the outlook page. No errors come up on
https://www.nicomaparkwx.com/wx/pages/f ... php?errors
@David. When I change to php 8.0 or 8.1 is when my site stops updating the Db. When I switch back to php 7.4 everything works fine. I can not find what the problem is and IONOS host is no help.
Will send credentials in private.
Re: meteotemplate php 8.0/8.1
Posted: Wed Oct 19, 2022 7:41 pm
by spd2612
Well got rid of the 401 from openweathermap error, but still not able to access
https://hurricanepub.com/pages/forecast/index.php or
https://hurricanepub.com/pages/station/ ... ndices.php
Everything else works, Im on PHP 8.1.11
the forcast index and climateindices are the newest ones that @davidefa has put out and its changed to openweathermap in main setup
I am guessing this is just how its going to be
Re: meteotemplate php 8.0/8.1
Posted: Wed Oct 19, 2022 9:35 pm
by spd2612
@davidefa
Well I found where the fatal error is but dont know how to fix it in Forcast/Index
Meteotemplate is calling
Code: Select all
https://api.openweathermap.org/data/2.5/onecall?lat=26.4648&lon=-81.8274&units=metric&appid=d652ede98033478481c733f05bc4a54a
Which returns a
Code: Select all
{"cod":401, "message": "Invalid API key. Please see https://openweathermap.org/faq#error401 for more info."}
In the browser, If I call
Code: Select all
https://api.openweathermap.org/data/2.5/weather?lat=26.4648&lon=81.8274&appid=d652ede98033478481c733f05bc4a54a
In the browser It returns data
So I changed
Code: Select all
$fIOURL = "https://api.openweathermap.org/data/2.5/onecall?lat=".$stationLat."&lon=".$stationLon."&units=metric&appid=".$fIOKey;
TO
Code: Select all
$fIOURL = "https://api.openweathermap.org/data/2.5/weather?lat=".$stationLat."&lon=".$stationLon."&units=metric&appid=".$fIOKey;
Its not pretty but the fatal error is gone
Still have multiple "Warning: Undefined array key "data" in"
Re: meteotemplate php 8.0/8.1
Posted: Thu Oct 20, 2022 9:27 pm
by spd2612
This is not pretty but it does get my climateindices.php to load
Of course there are still Deprecated: Function's but it will load I am not sure if some of these issues are comming with PHP 8.1.11 or not
At least im not getting a blank page
climateindices cause for fatal error commented out
Code: Select all
$temporary = round(array_sum($firstFrostDays)/count($firstFrostDays));
$averageFirstFrost = DateTime::createFromFormat('z', $temporary);
//$averageFirstFrostDay = $averageFirstFrost->format('j');
//$averageFirstFrostMonth = $averageFirstFrost->format('n');
//$averageFirstFrost = $averageFirstFrostDay." ".lang('month'.$averageFirstFrostMonth,'c');
}
if(count($lastFrosts)>0){
foreach($lastFrosts as $start){
$lastFrostDays[] = date("z",strtotime($start));
}
$temporary = round(array_sum($lastFrostDays)/count($lastFrostDays));
$averageLastFrost = DateTime::createFromFormat('z', $temporary);
//$averageLastFrostDay = $averageLastFrost->format('j');
//$averageLastFrostMonth = $averageLastFrost->format('n');
//$averageLastFrost = $averageLastFrostDay." ".lang('month'.$averageLastFrostMonth,'c');
Re: meteotemplate php 8.0/8.1
Posted: Fri Oct 21, 2022 5:12 pm
by spd2612
I got it all working except MPDF generation
pdf fails with this error, I can not find the reason why
Code: Select all
Fatal error: Uncaught TypeError: Mpdf\Mpdf::__construct(): Argument #1 ($config) must be of type array, string given, called in E:\hurricanepub\pages\forecast\forecastPDF.php on line 851 and defined in E:\hurricanepub\scripts\mpdf80\mpdf\mpdf\src\Mpdf.php:1032 Stack trace: #0 E:\hurricanepub\pages\forecast\forecastPDF.php(851): Mpdf\Mpdf->__construct() #1 {main} thrown in E:\hurricanepub\scripts\mpdf80\mpdf\mpdf\src\Mpdf.php on line 1032
Could this have something to do with me having metotemplate in the root without a template folder
Re: meteotemplate php 8.0/8.1
Posted: Fri Oct 21, 2022 8:21 pm
by andyk1
@ spd2612
When I access your page and run the cache reload icon at bottom right
https://hurricanepub.com/pages/forecast ... Cache=true
It seems to fix your page for awhile.
I had the same issue but still when I check a few hours later the issue is back.
Re: meteotemplate php 8.0/8.1
Posted: Fri Oct 21, 2022 9:11 pm
by spd2612
@ andyk1
@ davidefa
The page seems to work but it will not create a PDF
Also the forcast on the mobile page is wrong only shows 32 deg for everthing
Re: meteotemplate php 8.0/8.1
Posted: Sat Oct 22, 2022 2:47 am
by andyk1
Yep, for me either.
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 11:15 am
by juppie
Hello Gerrit
Today I updated you to 8.1 php.
It works very well

Thank you very much
Hello juppie
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 12:53 pm
by juppie
Hi
I took the php8_1.0.zip for the first update,
and then on the second update with php8_1.1.zip it worked
http://wetter-lehmschlenke.de/template/indexDesktop.php
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 1:11 pm
by spd2612
Im running PHP 8.1.11 and yes I have some warnings but my whole site works just fine
All plugins and blocks are not going to work correctly but you just have to decode what you can be happy with
Some of the plugins and blocks are so old that they should be removed as they are no longer updated
Dave has created a very nice add on that incorporates the block and plugin directory into the control panel unofficial blocks and plugins
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 2:26 pm
by andyk1
PHP 8.1.11 works for me also of many months of tinkering. Some block and plugins don't work for me (warningsUSRegions, ecowittModules and some minor) but overall I beat the Dec 31st deadline unless somethings change. You need to search (Upper right) through these treads to find the right answers to your problem.
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 2:37 pm
by andyk1
@ spd2612 I noticed your US regional warning block working. Mind sharing how you got it?
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 2:53 pm
by spd2612
I will look and see what version im running
Im not home right now so it will be later
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 10:29 pm
by spd2612
andyk1 wrote: ↑Sat Nov 19, 2022 2:37 pm
@ spd2612 I noticed your US regional warning block working. Mind sharing how you got it?
Unzip this to your homepage/blocks to see if it helps you its version 7
It is working on mine with PHP Ver. 8.1.11
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 10:43 pm
by spd2612
Andy You can see the warnings and it works as described on my site
but here is my page setup (NOW IM CONFUSED), It should not even be on my page, I did add it to the bottom as a test and it showed there to...
menuBlock(nws)
menuBlock(current)
menuBlock(stationData)
menuBlock(summary)
menuBlock(wind)
multipleBlock(webcam,50;videos,50)
multipleBlock(stationStatus,50;blank,50)
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 10:59 pm
by andyk1
spd2612 wrote: ↑Sat Nov 19, 2022 10:29 pm
andyk1 wrote: ↑Sat Nov 19, 2022 2:37 pm
@ spd2612 I noticed your US regional warning block working. Mind sharing how you got it?
warningsUSRegions.zip
Unzip this to your homepage/blocks to see if it helps you its version 7
It is working on mine with PHP Ver. 8.1.11
Hi and Thank you. I just installed it and it's working. Not to just get my ecowitt Module working.
Oh My host is now using PHP 8.1.12. Not sure what the difference is.
THANK YOU.
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 11:03 pm
by spd2612
andyk1 wrote: ↑Sat Nov 19, 2022 2:37 pm
@ spd2612 I noticed your US regional warning block working. Mind sharing how you got it?
nws is a modified NWS Alerts - Saratoga Script it has to be edited but works flawlessly Im sure I replaced region warnings with it for that reason There are some notes in the zip
What you are seeing is my NWS BLOCK
- nws.zip
- (415.73 KiB) Downloaded 845 times
menuBlock(nws)
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 11:06 pm
by andyk1
spd2612 wrote: ↑Sat Nov 19, 2022 10:43 pm
but here is my page setup (NOW IM CONFUSED), It should not even be on my page, I did add it to the bottom as a test and it showed there to...
I just noticed that. Check you see if you have two different versions installed as a block. Shouldn't be able to be used twice without modification.
Also your live cam is now dead.
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 11:08 pm
by andyk1
spd2612 wrote: ↑Sat Nov 19, 2022 11:03 pm
andyk1 wrote: ↑Sat Nov 19, 2022 2:37 pm
@ spd2612 I noticed your US regional warning block working. Mind sharing how you got it?
What you are seeing is my NWS BLOCK
OK Got cha. I like your NWS better. Thanks again.
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 11:27 pm
by andyk1
Yeah I'm still trying to figure out your nws block as it's modified for your location. Reading through the read me now.
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 11:37 pm
by spd2612
Thats always the problem I have so many modified scripts and programs I loose track when they just always work
I can look if you cant find it
I just had to write a script to read 80500 jason files to extract just the data i needed from the logs in mailwarebytes premium
Re: meteotemplate php 8.0/8.1
Posted: Sat Nov 19, 2022 11:43 pm
by spd2612
spd2612 wrote: ↑Sat Nov 19, 2022 11:03 pm
andyk1 wrote: ↑Sat Nov 19, 2022 2:37 pm
@ spd2612 I noticed your US regional warning block working. Mind sharing how you got it?
nws is a modified NWS Alerts - Saratoga Script it has to be edited but works flawlessly Im sure I replaced region warnings with it for that reason There are some notes in the zip
What you are seeing is my NWS BLOCK nws.zip
menuBlock(nws)
ok in NWS-ALERTS-CONFIG You will see what you need to change make sure you comment out Lee an Miami Dade unless you want my warnings
// ZONE CODES & COUNTY CODES CAN BE FOUND AT
https://alerts.weather.gov/
// LOCATION|Z CODE|C CODE
// Note: this array will be overridden by the Settings.php $SITE['NWSalertsCodes'] entry if using the Saratoga Base-USA template set
$myZC = array(
"Lee County FL Details|FLC071",
"Miami-Dade FL Details|FLC086",
//"Cecil County|MDZ008|MDC015",
//"Harford County (Southeast)|MDZ508|MDC025",
//"Harford County (Northwest)|MDZ507|MDC025",
//"Kent County|MDZ012|MDC029",
//"New Castle County|DEZ001|DEC003",
//"Chester County (Eastern)|PAZ102|PAC029",
//"Lancaster County|PAZ066|PAC071",
//"Chesapeake Bay north of Pooles Island MD|ANZ530",
//"Chester County (Western)|PAZ101|PAC029"
);
make sure in main settings sections your path's are correct