meteotemplate php 8.0/8.1

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

meteotemplate php 8.0/8.1

Post by davidefa » Thu Dec 23, 2021 6:29 pm

Testing meteotemplate on php 8.0 and it seems to work with minor updates.
A few blocks/plugins should be updated too.
Not sure everything else is working.

v1.0
- make a backup of your meteotemplate installation
- expand the archive php8_1.0.zip in the root folder of your installation
- install the updated blocks/plugins as needed

NOTE
This mod includes also a few fixes:
- cookies/samesite warnings
- control panel -> database extraSensors backup
- control panel -> 'edit data' and 'edit data extra sensors' fixes

NOTE 1
The included indoorData plugin is an update of the plugin described here: viewtopic.php?f=60&t=1998&p=9653&hilit=indoordata#p9653
Attachments
php8_plugins_1.0.zip
(161.12 KiB) Downloaded 223 times
php8_blocks_1.0.zip
(138.6 KiB) Downloaded 218 times
php8_1.0.zip
(46.32 KiB) Downloaded 185 times
Last edited by davidefa on Thu Aug 18, 2022 9:04 pm, edited 1 time in total.
Image

mchd17
Forecaster
Forecaster
Posts: 188
Joined: Sat Mar 17, 2018 2:01 am
Location: Illinois
Station model: Davis Pro2 Plus
Software: Meteobridge

Re: meteotemplate php 8.0

Post by mchd17 » Fri Dec 24, 2021 5:51 am

good work, youve been busy!

I will keep this in mind if my server gets updated.
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

Post by davidefa » Sat Dec 25, 2021 2:49 pm

v1.1
- added scripts directory ( not included in previous version )
- few fixes

NOTE
One of the problem for the conversion is that a few warnings that where generated before in some occasions ( which generally passed unobserved ) are now generating errors. So the scripts may stop unexpectedly anytime.
One of these functions generating errors is the 'count' function ( added an equivalent and more safe count8 function ).
Another source of errors are mathematical operations between values which include non proper numbers
Testing now on my server ( waiting for next error to fix )

@mchd17
I'd say a little bit 'incasinato' ( but I don't know how to translate it ; - )
Attachments
php8_1.1.zip
(97.04 KiB) Downloaded 203 times
Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: meteotemplate php 8.0

Post by Dehatter » Wed Feb 16, 2022 4:25 pm

Not sure if anyone else is having this issue.

ssGuages will display as designed, but the display but will not update.

Syntax Error: Unexpected End of JSON input.

Screenshot 2022-02-16 112409.jpg
Screenshot 2022-02-16 112409.jpg (106.02 KiB) Viewed 9021 times
Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: meteotemplate php 8.0

Post by Dehatter » Wed Feb 16, 2022 4:33 pm

Also a signature issue perhaps.

Fatal error: Array and string offset access syntax with curly braces is no longer supported in /homepages/5/d717902257/htdocs/template/plugins/stickers/stickerInteractiveAnim.php on line 1057
Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: meteotemplate php 8.0

Post by Dehatter » Wed Feb 16, 2022 4:41 pm

Went back to v7.4, then reinstalled the backup for ssGauge block I made and all is working. So just these 2 minor issues I noticed. I did nothing for the signature - it just started working again on its own using v7.4.

Just so you know.

Excellent work though. It seemed like everything else was working fine on v8.0.
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

Post by davidefa » Thu Feb 17, 2022 10:06 pm

Thanks for testing and for the feedback. Should post a few updates shortly.
Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: meteotemplate php 8.0

Post by Dehatter » Sun Jul 17, 2022 4:42 pm

So...

If you give up on ssGauges and go to the other gauges block ('gauges' ver 7.1), then use your blocks modified for PHP 8.0, I am working not only with PHP 8.0 but with PHP 8.1. Obviously the signature block is still messed up, but I am ok with that inconvenience.

One thing about the gauges block is that you can not change the color of the 'updated' highlight. Just for page consistency, I changed the highlight color on my current block to match the gauge block (#85D7E3).

Also, lesson learned, if you modify the gauge range for the temperatures, use a value that ends with a zero (like 110) or the block will round up to the nearest 10 for the background, yet the arrow will display based the value you entered. Example - I set the maximum value for 105 but this is what it looked like:
Screenshot 2022-07-17 133656.jpg
Screenshot 2022-07-17 133656.jpg (25.57 KiB) Viewed 8395 times
You can see the temp is 86, but the gauge shows well over 90.

- - - - -

Now my page is good until 12/2024 with no further intervention from me.

I will TOTALLY miss the extra information from the ssGuage mouseover and the wind rose, but the ssGuages GIT hub site has not been touched for 7 years so I do not feel like anyone is going to update it any time soon.

Database seems to be updating and all site functionality seems to be working.

FYI, I have an Ecowitt WS80 using a GW1000B to log my data to a meteobridge device.
Blocks used on my page:
Radar40, airQualityUS, astroEvents, cloudHeight, cloudTemp, co2, count, countDown, current, dayNight, dayPie, dbInfo, earthquakes, forecast, forecastGraphical, gauges, gfs, graphCombined, highLowUS, history, indoor, interactiveGraph, lightning, location, metarCustom, meteogram, moonPhase, nwsForecastCustom, radarUS, rain, riset, ssGauges, stationAverages, stationData, stationRecords, stationStatus, text, trends, usExtremeProbability, usSPC, uv, videos, warningsUSRegions, weatherNetworks, webcam, webcamTimelapse, wind, windy, worldTime

Tom
www.meckweather.com

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

Post by davidefa » Mon Jul 18, 2022 10:05 pm

Thanks for trying ( and for the feedback ).
Regarding the steelSeries plugin I updated it ( to fix an error in case selected time format is am/pm ): viewtopic.php?f=60&t=2096#p11453
Need to dig further about ssGauges and windRose blocks and php 8.1 compatibility.
Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: meteotemplate php 8.0

Post by Dehatter » Tue Jul 19, 2022 2:38 pm

You are my latest and greatest hero. I missed that thread!

Thank you so very much,

Plugin works great, but I am having trouble with the block working.

Tom
www.MeckWeather,com
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

Post by davidefa » Mon Aug 01, 2022 2:14 pm

Plugin stickers ver 7.3:
- fixed compatibility with php 8.0/8.1 ( www.davidefabbri.net/files/stickers_7.3.zip )
Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: meteotemplate php 8.0

Post by Dehatter » Thu Aug 04, 2022 2:27 pm

Works for me!

Thank you very much!

Tom
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

Post by meteoesine » Sat Aug 13, 2022 5:57 am

Ciao,
I've definitively set my host for the php 8.1 version (8.1.8 to be precise)
davidefa's mods workd pretty fine but as far as I'm concerned there are still a couple of things that still don't work

* https://meteoesine.it/template/pages/st ... tDaily.php
* https://meteoesine.it/template/pages/st ... ndices.php
many thanks in advance to try to fix them asap
Attachments
ScreenShot01096.jpg
ScreenShot01096.jpg (28.78 KiB) Viewed 8140 times
ScreenShot01097.jpg
ScreenShot01097.jpg (37.68 KiB) Viewed 8140 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

Post by davidefa » Sun Aug 14, 2022 10:10 am

Yes, all scripts in pages directory need to be updated ( added in my todo list )
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 » Thu Aug 18, 2022 9:33 pm

Updated the pages and mobile directories ( mobile pages only minimally tested )
- updated the forecast to use openweathermap.org api, ( in place of darksky.net that should retire next march ), insert the api key, in the main setup, in place of the darksky one
- pdf generation should be ok
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 » Sat Sep 17, 2022 10:27 pm

I have to update my server to PHP 8.0
I Know in its current state 18.0 it wont work my biggest concern is ecowitt plugin which I require for my WS 2902A to work
What should I download ? This has a lot of different posts here making it confusing.
Do I just need the 3 zips in the top post?
Thanks in advance

I just looked at what I have done over the years

Blocks installed

Blank block
current Current Conditions Block
logo
naSatellite North American Satellite
nws NWS Alerts - Saratoga Script 1.1
radarUS
ssGauges Steel Series Gauges 3.1
Station Status 5.0
Summary 5.4
Videos 1.0
warningsUSRegions
Weather Networks block
webcam
Wind

Plugins Installed



airTraffic 1.1
apiViewer 1.0
bloomSky 3.0
contact 3.0
diary 4.0
ecowitt 2.8
pageBuilder
steelSeries 4.0
stickers
Image

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

G4MHJ
Observer
Observer
Posts: 18
Joined: Mon Jul 30, 2018 7:51 am
Location: Erith, Kent, UK
Station model: VP2+
Software: Meteobridge Pro

Re: meteotemplate php 8.0/8.1

Post by G4MHJ » Wed Oct 05, 2022 5:21 pm

I have just found this post following a notification from One.Com that they have moved to PHP 8.0. With 8.0 the template doesn't respond which reading the above was expected. I was able to force a move back to 7.4 but this will cease on 28th November. My immediate thought was to abandon the weather site altogether which would be a great shame as I have other non-weather pages attached to it such as Gallery. I have read a few of the posts but I don't think my brain is making much sense of it.
Is there a step by step guide to correct this or is it an ongoing exercise.

Thanks
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 » Mon Oct 10, 2022 3:04 pm

This is an update of the first post.

v1.1
- make a backup of your meteotemplate installation
- expand the archive php8_1.1.zip in the root folder of your installation
- install the updated blocks/plugins as needed
- updated the forecast to use openweathermap.org api, ( in place of darksky.net that should retire next march ), insert the api key, in the main setup, in place of the darksky one

http://www.davidefabbri.net/files/php8_1.1.zip

NOTE
This is not the same archive as the first post ( even if the name is the same, sorry for the confusion ), use this archive

P.S.
Currently converting blocks and plugins, if you have a non functioning block/plugin please drop a note

P.P.S.
If you don't 'feel brave enough' to test this mod on your main site ( or if you simply want to create a meteotemplate 'test site' ) you can create a 'parasite meteotemplate' ( a site that share the same database as the main one ):
- copy your main site from 'template' to 'template1' directory
- edit your template1/config.php in line 19 from:

Code: Select all

$path = '/template/';
to

Code: Select all

$path = '/template1/';
- expand the archive php8_1.1.zip in the template1 directory
- last step, create a symlink so that template1/meteotemplateLive.txt points to template/meteotemplateLive.txt ( or you can use a cron job that copies template/meteotemplateLive.txt to template1/meteotemplateLive.txt every minute or so )
Point your browser to the 'template1' directory and you should be able to see your 'parasite meteotemplate site'



@spd2612
ecowitt plugin v2.11 or 3.0 should be ok ( I currently use v2.11 with php 8.0 )
Most of the blocks/plugin you mention should be php 8.0 compatible, just install last version

@G4MHJ
Just follow the above steps and you should be ok, as you say, this is a work in progress any feedback is welcome
Last edited by davidefa on Wed Feb 15, 2023 12:17 am, edited 2 times 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 » Thu Oct 13, 2022 9:06 pm

I am using PHP 8.0 although I dont see any issues with the template My PHP log is filled with this error any idea where its comming from?

Code: Select all

[06-Oct-2022 21:18:12 America/New_York] PHP Warning:  Undefined variable $base in E:\hurricanepub\api.php on line 69
I do have a couple more errors but this one is constant
Image

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

Gerrit
Observer
Observer
Posts: 39
Joined: Wed Feb 06, 2019 1:31 pm
Station model: Vantage pro 2 plus
Software: Meteobridge
Contact:

Re: meteotemplate php 8.0/8.1

Post by Gerrit » Fri Oct 14, 2022 1:54 pm

Good Day,

I have switched my site to PHP 8.0 and come across a little problem, which works with 7.4.
I can see the page
https://www.waskolkweer.nl/meteotemplat ... ndices.php.
I can't open the page, I can't find anything about it, but maybe I'm not looking properly.

Gerrit

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 Oct 14, 2022 2:45 pm

@Gerrit
I think you still have the original climateIndices.php file try substituting with the attached one ( uncompress it in the pages/station directory )

@spd2612
You can use the last api.php script ( the attached one is ok, extract it in the root directory of your meteotemplate installation )
Attachments
api_3.4.zip
(12.59 KiB) Downloaded 113 times
climateIndices.zip
(6.04 KiB) Downloaded 87 times
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 » Fri Oct 14, 2022 4:44 pm

@davidefa

That did seem to fix those PHP ERRORS Thank you very much .

should I be using v1.1
- added scripts directory ( not included in previous version )
- few fixes


Not sure if I am using that or not I went ahead and put the v1.1 update on just to be sure

Here is the other error Im getting

Code: Select all

[14-Oct-2022 12:54:32 America/New_York] PHP Warning:  Undefined array key "" in E:\hurricanepub\include\include.php on line 468
And the Forcast page has a fatal error

Code: Select all

Warning: Undefined array key "madis-stations" in E:\hurricanepub\pages\forecast\index.php on line 483 Fatal error: Uncaught TypeError: implode(): Argument #1 ($pieces) must be of type array, string given in E:\hurricanepub\pages\forecast\index.php:483 Stack trace: #0 E:\hurricanepub\pages\forecast\index.php(483): implode() #1 {main} thrown in E:\hurricanepub\pages\forecast\index.php on line 483
https://hurricanepub.com/pages/forecast ... php?errors
Image

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

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 » Fri Oct 14, 2022 11:47 pm

I did the same. Just copied over existing files with david's newest php 8.0-8.1

Does not work for me. This time the page loads but does not update the api or datadase with new dataon ionos.com host server. I get the following errors but only showing the forcast/index.php errors for now.


Notice: Undefined variable: returner in /homepages/37/d726071500/htdocs/wx/scripts/headerMetar.php on line 686

Warning: file_get_contents(https://api.openweathermap.org/data/2.5 ... 4cdc4010f8): failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in /homepages/37/d726071500/htdocs/wx/pages/forecast/index.php on line 77

Warning: array_key_exists() expects parameter 2 to be array, null given in /homepages/37/d726071500/htdocs/wx/pages/forecast/index.php on line 109

Warning: array_key_exists() expects parameter 2 to be array, null given in /homepages/37/d726071500/htdocs/wx/pages/forecast/index.php on line 220

Warning: array_key_exists() expects parameter 2 to be array, null given in /homepages/37/d726071500/htdocs/wx/pages/forecast/index.php on line 340

Warning: array_key_exists() expects parameter 2 to be array, null given in /homepages/37/d726071500/htdocs/wx/pages/forecast/index.php on line 485

Warning: array_key_exists() expects parameter 2 to be array, null given in /homepages/37/d726071500/htdocs/wx/pages/forecast/index.php on line 501
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 » Sat Oct 15, 2022 4:41 am

@spd2612
I think you still have the original pages/forecast/index.php script try substituting with the attached one ( uncompress it in the pages/forecast directory )
The other error refers to include\include.php script, which is not part of meteotemplate, so can't help about that ( or you could zip and post the content of the script so I can take a look )


@andyk1
Regarding the error in the forecast page you need to register on the openweathermap get an api key and insert it in the meteotemplate main setup ( in place of the darksky api key )
Regarding the database not updating i think that i could debug the issue having access to your meteotemplate site ( either having access to your hosting provider control panel or simply having an ftp access to your site )
Attachments
PagesForecastIndex.zip
(15.67 KiB) Downloaded 94 times
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 » Sat Oct 15, 2022 12:44 pm

The file did not fix this
https://hurricanepub.com/pages/forecast/index.php
I think you still have the original pages/forecast/index.php script try substituting with the attached one ( uncompress it in the pages/forecast directory )
The other error refers to include\include.php script, which is not part of meteotemplate, so can't help about that ( or you could zip and post the content of the script so I can take a look )
see attached
include.zip
(3.2 KiB) Downloaded 81 times
Image

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

Post Reply