meteotemplate php 8.0/8.1

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: meteotemplate php 8.0/8.1

Post by andyk1 » Sun Nov 20, 2022 2:07 am

Yes I got it all configures and restarted the cache files per the command in one of the files but can't find "No Current Weather Alerts in/around Lee/Miami Dade County" Which I am assuming is in another file I can't seem to find even with Note++'s great search feature. I'm just tired and can't think hehehe.

BTW, watch those rip currents... :lol:
Image

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: meteotemplate php 8.0/8.1

Post by andyk1 » Sun Nov 20, 2022 2:24 am

Nevermind. I found it. Line 59 of file "nws-alerts-config.php" incase anyone else is looking for it.
Image

spd2612
Forecaster
Forecaster
Posts: 165
Joined: Thu Jan 23, 2020 4:00 pm
Location: Fort Myers
Station model: WS-5000/GW1100
Software: ECOWITT Plugin
Contact:

Re: meteotemplate php 8.0/8.1

Post by spd2612 » Sun Nov 20, 2022 3:08 am

andyk1 wrote: Sun Nov 20, 2022 2:24 am Nevermind. I found it. Line 59 of file "nws-alerts-config.php" incase anyone else is looking for it.
Yup and this one works well it was originally written for Saratoga template
Dave probably should add it
I guess these settings could be made from the cp pretty easy but once its done its done
Image

Ambient Weather WS-5000
Ultrasonic Anemometer
Thermo-Hygrometer Sensor WH31E
Soil Moisture Sensor WH31SM
Lightning Detection WH31L

riteoh
Observer
Observer
Posts: 36
Joined: Wed Oct 27, 2021 4:44 am

Re: meteotemplate php 8.0/8.1

Post by riteoh » Sat Dec 31, 2022 1:30 am

Having had issues with the site for the last couple of weeks at least, I have changed the PHP version on my site to 8.1, uploaded the extracted files from php8_1.1.zip, cleared my cache and reloaded my site.

Reloading the site, and I get a HTTP error 500 (same error if I change to 8.0).

Changing back to 7.4, and there is a white page with header and page links again... but the links do not load new pages, and formatting is wrong.

www.eyesontheweather.com.au.

Any ideas what is going wrong?

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Tue Jan 10, 2023 2:43 pm

Received an e-mail today from my provider that they will disable PHP 7.4 in February 2023.
So I was brave, did a backup, copied all pages from php8_1.1.zip to my site, modified PHP to 8.0 and started over.
Until now, all seems working as before. But I did not use much plugins/blocks.

So I played with available PHP versions and switched to 8.1 and finally to 8.2.
No issues seen until now.

Regards
Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Tue Jan 10, 2023 8:49 pm

Just found a -very- little issue, but not sure, if this is related to PHP version or if the issue is since some time present. :oops:

In setup I checked in footer to display the season image at lower left.
Noticed, that this icon isnt displayed any longer, optíon for season image was by astronomical seasons.
After switching to meterological seasons the icon is displayed again.

In "Astronomical" the solstice and equinox dates are dispayed correctly.
So any idea if the option "Astronomical seasons" is not working due to the PHP version or is caused by an other issue?

Regards
Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Wed Jan 11, 2023 2:07 pm

May be I was to early...
Since some hours the site is off-line. Some browsers report an error 500, others still show a blank page.
But only, if the indexDesktop.php is adressed, adressing the indexMobile.php still works.

Currently no idea, why site went off from one minute to the other.
My guess is that at provider site something changed or that today something of yesterdays modifications start working.

Still investigating... :cry:

Regards

OK, Google brings a solution: switched back to PHP 8.0 and site is online again.
Found, that utf8_encode will not work from PHP 8.1 upward. So it seems, that yesterday switching the PHP versions 8.1/8.2 was not set to active (with all functions) immediately.

Edit Jan., 22th 2023: I did switch to PHP 8.1.14 two days ago. Seems my trouble when switching for a first time was caused by the provider. I noticed, that my website was off several times for a couple of minutes. So my guess is, that there are some background tasks active from provider site. Up to now no more issues occured.

http://www.gross-umstadt-wetter.de
Last edited by FSC830 on Sun Jan 22, 2023 11:20 am, edited 1 time in total.
Image

spd2612
Forecaster
Forecaster
Posts: 165
Joined: Thu Jan 23, 2020 4:00 pm
Location: Fort Myers
Station model: WS-5000/GW1100
Software: ECOWITT Plugin
Contact:

Re: meteotemplate php 8.0/8.1

Post by spd2612 » Wed Jan 11, 2023 2:59 pm

I am running 8.1.13 without to many issues
I have always had issues to address with meteotemplate and php but the plugins and blocks can contribute to that
Some of the plugins are old and were not updated
I have dumped the ones that are problematic
Some of the updates that are done in php versions need to be done but some of the php just makes no sence to change, just breaks stuff
Image

Ambient Weather WS-5000
Ultrasonic Anemometer
Thermo-Hygrometer Sensor WH31E
Soil Moisture Sensor WH31SM
Lightning Detection WH31L

meteoparquecoimbra
Newbie
Newbie
Posts: 8
Joined: Fri Oct 19, 2018 11:49 am
Station model: WMR928NX, Oregon Scientic
Software: Virtual Weather Station
Contact:

Re: meteotemplate php 8.0/8.1

Post by meteoparquecoimbra » Sat Jan 14, 2023 2:50 pm

The php8_1.1.zip mods worked on my meteotemplate. running with php 8.0 on Strato. Many thanks to the author.

https://www.meteoparquecoimbra.es/indexDesktop.php

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Wed Jan 18, 2023 4:42 pm

Tried to setup an virtual environment for testing. OS is Ubuntu 22.04, after installing Apache, PHP and mysql the system is finally ready for operation. To find to correct versions was a bit messing around, but now it seems running (more or less).

What I did: downloaded a complete package with meteotemplate_v18, the php8_1.0.zip and the php8_1.1.zip.
Extract all archives, copied first the files from PHP8_1.0 to the referring locations, then the files from PHP8_1.1.

Finally transferred all to my web directory.

Starting the setup seems to be fine:
mt_01.png
mt_01.png (44.62 KiB) Viewed 1457 times
mt_02.png
mt_02.png (25.48 KiB) Viewed 1455 times
Config file was created, but when accessing the web site, I got only a blank screen and an update notice???
Yes, there is no real data in DB, is is just an empty dummy DB, but I expected at least that blocks, header and footer is visible.
But there is not even an error message, just blank!? :shock:
mt_03.png
mt_03.png (25.57 KiB) Viewed 1457 times
I did the installation now multiple times, always with same result. Anyone an idea?
At my real web server (hosted by Strato) running with PHP 8.0 is working without issues (as noticed until today).

Regards

Edit Jan., 22th 2023: To still curiousity I did the same installation (VM) with PHP 7.4, runs exactly as expected. No idea, why PHP 8.0 behaves in this strange way.
BTW the real website is now running with PHP 8.1.14, see my post above.
Image

martinb978
Newbie
Newbie
Posts: 1
Joined: Mon Jan 27, 2020 10:38 pm
Station model: Davis Vantage Vue
Software: MeteoBridge

Re: meteotemplate php 8.0/8.1

Post by martinb978 » Thu Jan 26, 2023 12:10 am

Hi, Complete amateur at this so apologies. Just about to call it a day with Meteotemplate after my host one.com upgraded to php 8 and my site gave up. I have found the php8_1 fix and it has given me a bit of light at the end of the tunnel. However on loading I at last got something resembling my original site butI am presented with errors relating to variables not being found:
Warning: Undefined array key "THIS" in /customers/0/f/3/thurltonweather.co.uk/httpd.www/template/scripts/headerMetar.php on line 426 Warning: Undefined array key "THIS" in /customers/0/f/3/thurltonweather.co.uk/httpd.www/template/scripts/headerMetar.php on line 427 Warning: Undefined array key "THIS" in /customers/0/f/3/thurltonweather.co.uk/httpd.www/template/scripts/headerMetar.php on line 428 Warning: Undefined array key "THIS" in /customers/0/f/3/thurltonweather.co.uk/httpd.www/template/scripts/headerMetar.php on line 432 Warning: Undefined array key "THIS" in /customers/0/f/3/thurltonweather.co.uk/httpd.www/template/scripts/headerMetar.php on line 433 Warning: Undefined array key "THIS" in /customers/0/f/3/thurltonweather.co.uk/httpd.www/template/scripts/headerMetar.php on line 434 Warning: Undefined array key "THIS" in /customers/0/f/3/thurltonweather.co.uk/httpd.www/template/scripts/headerMetar.php on line 435 Warning: Undefined array key "THIS" in /customers/0/f/3/thurltonweather.co.uk/httpd.www/template/scripts/headerMetar.php on line 436 Warning: Undefined array key "THIS" in /customers/0/f/3/thurltonweather.co.uk/httpd.www/template/scripts/headerMetar.php on line 437 Warning: file_get_contents(http://www.meteotemplate.com/web/latestVersions.txt): Failed to open stream: Connection timed out in /customers/0/f/3/thurltonweather.co.uk/httpd.www/template/indexDesktop.php on line 99
0.0 km/h

Managed to get rid of the very first error $moreclouds not being defined but after that am at a loss. The 'THIS' does not exist in this area

Any help would be greatly appreciated

Thanks

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Thu Jan 26, 2023 10:01 am

Did you really installed (copied) ALL files from the archive to the referring site at your host?
It seems, that there is at least one file not using the proper version.

Regards
Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Mon Jan 30, 2023 1:23 pm

Just seen, that the "undefied array key" error disappeared.
What was the solution?

Regards
Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Fri Feb 03, 2023 2:09 pm

Done! :D

Finally, after some "try and error" I succeeded. No more warnings/deprecated messages with PHP 8.1 at my site.
Now starting to check PHP 8.2 or even a higher version.

But hopefully it will take time until provider will discontinue 8.1 8-) .

Regards
Image

alexvanuxem
Forecaster
Forecaster
Posts: 182
Joined: Mon Jan 31, 2022 4:41 pm
Location: Sint-Katelijne-Waver, Belgium
Station model: Davis Vantage Pro 2
Software: Meteobridge
Contact:

Re: meteotemplate php 8.0/8.1

Post by alexvanuxem » Fri Feb 03, 2023 3:49 pm

Hi,

cool, thank you for your work!

Can I fetch all files needed to upgrade my site to 8.0 from this thread?

Or can you give me the path where to find all needed?

Thank you!!

Grtz

Alex
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: meteotemplate php 8.0/8.1

Post by davidefa » Fri Feb 03, 2023 4:14 pm

@alexvanuxem
This post/thread should should contain all you need (

@FSC830
Did you find something not working or clear in above instructions, or did you have to take other steps?

@martinb978
Does you site works as expected?
A few block need to be updated ( old one are not php8 compatible ), at least meteogram and weathernetworks
Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Fri Feb 03, 2023 4:32 pm

Hi,

yes, I needed to modify a bit more, in total six pages.
I have just sent an e-mail to Jachym asking for allowance to post this pages here.

What I can say so for is that I modified following pages:

/header.php
/scripts/functions.php
/scripts/headerMetar.php
/homepage/css/themeSetter.php
/homepage/blocks/current/currentBlock.php
/homepage/blocks/worldTime/worldTimeBlock.php

Calling the site with ?errors does not give any messages back as far as I tested.
I did not take care about the meteogram, which does not load when ?errors is used, it loads, when called normally.

gross-umstadt-wetter.de

Regards

Edit: A delay can sometimes be an advantage. Found some more warnings to fix, the challenge is, that the messages depending to current weather conditions. I cant simulate all but by chance this afternoon the local conditions changed a bit and a new warning raised.
In addition I installed some plugins I did not used until today and found some more to fix too.
But main target was to fix the most used pages, this is done and ongoing...
Last edited by FSC830 on Sat Feb 04, 2023 11:48 am, edited 1 time in total.
Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Sat Feb 04, 2023 11:47 am

Hi,
Jachym agreed that I can upload the modified files here.
For better difference I named the archive FSC... This archive does NOT contain the files in the PHP81 archives from @davidefa, so you need to install the files from his archive first!

Its highly recommended to do a backup of your current files prior installing the modified ones.
Also please note, that I cant confirm that I found all deprecated functions, so may be, in certain (weather) conditions, an error/warning might be occur!
At least at my site I do not get a warning/deprecated message when calling the indexDesktop.php during usual conditions.
You should extract the archive into an empty folder, the directoy structure refers to the directory structure of the Meteotemplate installation. Just copy (after backup) the files to the referring location at your MT host.

FSC_PHP81_v1_4.zip
(102.58 KiB) Downloaded 54 times

Version 1.1 (removed), minor bugfix in header.php (interactiveBanner is operative again), added some pages.
Version 1.2 (removed), major bugfix in header.php (weather background in banner is operative again, in v1.1. only day/night switch was running)
Version 1.3 (removed), some pages added.
version 1.4 uploaded.
Changes in 1.4:
Removed Moon during day time, Metar string CAVOK (Clouds And Visibility OK) is handled like "partly cloudy" (=> uses same background image instead of default blank), currentBlock is modified to download forecast data using metric units.
In prevoius versions "standard" was used, but this causes issues in forecast data.

Also: use at your own risk, no warranty that all is running as expected. If you find an error, please post a reply here in forum, add the !!exact!! message.
I am not 24/7 online, also there is no entitlement for support ;) . Anyway, if I find the time I will try to fix an reported error.

Regards

Edit: A feedback about the outcome after installation at your MT site is also highly welcome! 8-)
Last edited by FSC830 on Wed Feb 22, 2023 5:56 pm, edited 13 times in total.
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: meteotemplate php 8.0/8.1

Post by meteoesine » Sun Feb 05, 2023 6:22 am

Hi,
if possible it would rather be to fix the annual rain statistics, which with php 8.1 displays only the first year entered in the archive. (only for rain, all other stats work correctly)
thanks

/template/pages/st ... .php?var=R

and now my host proposes php 8.2 as a novelty.... an endless story, we never get out of it :(
as far as I'm concerned, until it's available, I use php7.4
Attachments
74.png
74.png (49.14 KiB) Viewed 1238 times
81.png
81.png (22.64 KiB) Viewed 1238 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: meteotemplate php 8.0/8.1

Post by davidefa » Sun Feb 05, 2023 11:36 am

The attached mod should fix it:
- expand in the root directory of meteotemplete
Attachments
climate5_php8.1a.zip
(2.07 KiB) Downloaded 56 times
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: meteotemplate php 8.0/8.1

Post by meteoesine » Sun Feb 05, 2023 4:24 pm

perfect! swiched now to php8.1
grazie Davide
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

alexvanuxem
Forecaster
Forecaster
Posts: 182
Joined: Mon Jan 31, 2022 4:41 pm
Location: Sint-Katelijne-Waver, Belgium
Station model: Davis Vantage Pro 2
Software: Meteobridge
Contact:

Re: meteotemplate php 8.0/8.1

Post by alexvanuxem » Sun Feb 05, 2023 4:56 pm

thank you all, i will try to this asap, but it seems a hard work that will not be done in an evening.

keep you posted about the outcome

cheer!!
Image

livefeed
Observer
Observer
Posts: 20
Joined: Sat Jan 26, 2019 6:05 am
Location: Lusby, MD
Station model: Davis pro 2
Software: Meteobridge
Contact:

Re: meteotemplate php 8.0/8.1

Post by livefeed » Fri Feb 10, 2023 6:21 pm

Been following this post and have updated all the files as mentioned above, only thing not working for me is the layout looks a mess - not sure if its a browser issue or do I need to run the install again after the file uploads?
Attachments
Screenshot 2023-02-10 at 1.19.47 PM.png
Screenshot 2023-02-10 at 1.19.47 PM.png (352.97 KiB) Viewed 1132 times
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: meteotemplate php 8.0/8.1

Post by davidefa » Fri Feb 10, 2023 8:36 pm

I see you have http to https redirection enabled.
Check in the install/setup.php that your pageUrl ( point 1 ) includes https://

setup.png
setup.png (94.47 KiB) Viewed 1127 times
Image

AmateurExtra
Newbie
Newbie
Posts: 7
Joined: Tue Aug 18, 2020 4:22 am
Station model: Davis Vantage Pro2 Plus
Software: Meteobridge
Contact:

Re: meteotemplate php 8.0/8.1

Post by AmateurExtra » Mon Feb 13, 2023 10:54 pm

Incasinato, ora guarito o in via di guarigione. Lavoro eccellente!
Member CoCoRaHS, Extra Class Amateur Radio Operator, N3UVR

Post Reply