Page 3 of 4

Re: meteotemplate php 8.0/8.1

Posted: Sun Nov 20, 2022 2:07 am
by andyk1
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:

Re: meteotemplate php 8.0/8.1

Posted: Sun Nov 20, 2022 2:24 am
by andyk1
Nevermind. I found it. Line 59 of file "nws-alerts-config.php" incase anyone else is looking for it.

Re: meteotemplate php 8.0/8.1

Posted: Sun Nov 20, 2022 3:08 am
by spd2612
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

Re: meteotemplate php 8.0/8.1

Posted: Sat Dec 31, 2022 1:30 am
by riteoh
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?

Re: meteotemplate php 8.0/8.1

Posted: Tue Jan 10, 2023 2:43 pm
by FSC830
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

Re: meteotemplate php 8.0/8.1

Posted: Tue Jan 10, 2023 8:49 pm
by FSC830
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

Re: meteotemplate php 8.0/8.1

Posted: Wed Jan 11, 2023 2:07 pm
by FSC830
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

Re: meteotemplate php 8.0/8.1

Posted: Wed Jan 11, 2023 2:59 pm
by spd2612
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

Re: meteotemplate php 8.0/8.1

Posted: Sat Jan 14, 2023 2:50 pm
by meteoparquecoimbra
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

Re: meteotemplate php 8.0/8.1

Posted: Wed Jan 18, 2023 4:42 pm
by FSC830
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 36134 times
mt_02.png
mt_02.png (25.48 KiB) Viewed 36132 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 36134 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.

Re: meteotemplate php 8.0/8.1

Posted: Thu Jan 26, 2023 12:10 am
by martinb978
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

Re: meteotemplate php 8.0/8.1

Posted: Thu Jan 26, 2023 10:01 am
by FSC830
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

Re: meteotemplate php 8.0/8.1

Posted: Mon Jan 30, 2023 1:23 pm
by FSC830
Just seen, that the "undefied array key" error disappeared.
What was the solution?

Regards

Re: meteotemplate php 8.0/8.1

Posted: Fri Feb 03, 2023 2:09 pm
by FSC830
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

Re: meteotemplate php 8.0/8.1

Posted: Fri Feb 03, 2023 3:49 pm
by alexvanuxem
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

Re: meteotemplate php 8.0/8.1

Posted: Fri Feb 03, 2023 4:14 pm
by davidefa
@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

Re: meteotemplate php 8.0/8.1

Posted: Fri Feb 03, 2023 4:32 pm
by FSC830
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...

Re: meteotemplate php 8.0/8.1

Posted: Sat Feb 04, 2023 11:47 am
by FSC830
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 1026 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-)

Re: meteotemplate php 8.0/8.1

Posted: Sun Feb 05, 2023 6:22 am
by meteoesine
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

Re: meteotemplate php 8.0/8.1

Posted: Sun Feb 05, 2023 11:36 am
by davidefa
The attached mod should fix it:
- expand in the root directory of meteotemplete

Re: meteotemplate php 8.0/8.1

Posted: Sun Feb 05, 2023 4:24 pm
by meteoesine
perfect! swiched now to php8.1
grazie Davide

Re: meteotemplate php 8.0/8.1

Posted: Sun Feb 05, 2023 4:56 pm
by alexvanuxem
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!!

Re: meteotemplate php 8.0/8.1

Posted: Fri Feb 10, 2023 6:21 pm
by livefeed
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?

Re: meteotemplate php 8.0/8.1

Posted: Fri Feb 10, 2023 8:36 pm
by davidefa
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 35804 times

Re: meteotemplate php 8.0/8.1

Posted: Mon Feb 13, 2023 10:54 pm
by AmateurExtra
Incasinato, ora guarito o in via di guarigione. Lavoro eccellente!