Page 1 of 1

Problem Php 8.2 homepage admin

Posted: Fri Dec 08, 2023 5:20 pm
by Cavaliere
When I update the php version to 8.2, the admin home page is no longer reachable, it gives me this error

https://www.ombarcellonapg.com/wdisplay ... php?errors

Fatal error: Uncaught mysqli_sql_exception: Expression #1 of ORDER BY clause is not in SELECT list, references column 'Sql1757460_1.alldata.DateTime' which is not in SELECT list; this is incompatible with DISTINCT in /web/htdocs/www.ombarcellonapg.com/home/wdisplay/te ... dex.php:41 Stack trace: #0 /web/htdocs/www.ombarcellonapg.com/home/wdisplay/te ... ex.php(41): mysqli_query() #1 {main} thrown in /web/htdocs/www.ombarcellonapg.com/home/wdisplay/te ... /index.php on line 41

Then I have notable errors, just see at this address, but they are all due to the move to the new server, how can I correct them?

https://www.ombarcellonapg.com/wdisplay ... php?errors

Re: Problem Php 8.2 homepage admin

Posted: Fri Dec 08, 2023 9:17 pm
by davidefa
Try changing php version to 7.x ( I'm still on meteotemplate 18.0, not sure meteotemplate 19.0 is 'fully php 8.x ready', I'm slooowly testing it )

Re: Problem Php 8.2 homepage admin

Posted: Fri Dec 08, 2023 10:31 pm
by Cavaliere
Hi Davidefa,

but in reality I first on the previous supplier, I had version 8.2 and I didn't have any problems, everything went smoothly.

Now I'm having this problem with Aruba.

While for the other errors, could you help me solve them?

I put the php 7 version back but there are still errors if I try with "?errors" at the end of the link.

------

Ciao Davidefa,

ma in realtà io prima sul fornitore precedente, avevo la versione 8.2 e non avevo nessun problema, andava tutto liscio.

Adesso con aruba sto riscontrando questo problema.

Mentre per gli altri errori, potresti aiutarmi a risolverli?

Ho rimesso la versione di php 7 ma ci sono degli errori ancora se provo con ?errors a fine del link.

Re: Problem Php 8.2 homepage admin

Posted: Fri Dec 08, 2023 11:02 pm
by davidefa
Ok, if you are with aruba check if you have the ONLY_FULL_GROUP_BY problem ( see this thread for example:http://www.meteotemplate.com/forum/viewtopic.php?t=2100 )
In short you should disable this flag in the mysql database.

P.S.
The warnings you see are not 'super important', part of them are a few glitches in the scripts/functions.php script.

Re: Problem Php 8.2 homepage admin

Posted: Fri Dec 08, 2023 11:19 pm
by Cavaliere
davidefa wrote: Fri Dec 08, 2023 11:02 pm Ok, if you are with aruba check if you have the ONLY_FULL_GROUP_BY problem ( see this thread for example:http://www.meteotemplate.com/forum/viewtopic.php?t=2100 )
In short you should disable this flag in the mysql database.

P.S.
The warnings you see are not 'super important', part of them are a few glitches in the scripts/functions.php script.
I looked around my provider, there is no entry you indicated in the phpmyadmin database. I also tried to do a search from the appropriate form and it's not there.

From the admin panel in the php management, there is the management of the php.ini file which I attach below in the screen, but the indicated entry does not appear to be there.
See if it could be one of those shown in the photo.

Re: Problem Php 8.2 homepage admin

Posted: Fri Dec 08, 2023 11:31 pm
by Cavaliere
solved like this, thanks DAVIDEFA:

- you could add the following to your config.php script near line 15 ( after line beginning with '$con =' ). I used in my aruba domain which has the same problem, and it seems working.
CODE: SELECT ALL

Code: Select all

mysqli_query($con,"SET SESSION sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))");

While I wanted to ask if it was normal, that in the database in the alldata folder, I don't see the last days data saved?

Re: Problem Php 8.2 homepage admin

Posted: Fri Dec 08, 2023 11:39 pm
by davidefa
The page you posted is relative to the php settings.
This is a settings of mysql
For example in phpmyadmin, select your database and in the sql tab execute the following query:

Code: Select all

SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE; 
Check in the result if the flag is present, in my local database is disabled:

database_01.png
database_01.png (161.41 KiB) Viewed 17430 times

Re: Problem Php 8.2 homepage admin

Posted: Fri Dec 08, 2023 11:44 pm
by Cavaliere
davidefa wrote: Fri Dec 08, 2023 11:39 pm The page you posted is relative to the php settings.
This is a settings of mysql
For example in phpmyadmin, select your database and in the sql tab execute the following query:

Code: Select all

SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE; 
Check in the result if the flag is present, in my local database is disabled:


database_01.png
Is this to check if data is being written to the database, within the ALLDATA table? ?

Re: Problem Php 8.2 homepage admin

Posted: Fri Dec 08, 2023 11:59 pm
by davidefa
No, this is only to check if the flag is enabled ( didn't see you already solved the problem ). So disregard my last reply.

It is not normal that data is missing. I see in your extended graphs that you have missing data in the last few days ( a large gap from 5 to 7 and few smaller ones ), but last few hours are regular.
Are you referring to the main table data ( alldata ) or the extended table data ( alldataExtra )?
I see you save in your extended table only the UV data, but are unable to see if the data is present.

Re: Problem Php 8.2 homepage admin

Posted: Sat Dec 09, 2023 7:07 am
by Cavaliere
davidefa wrote: Fri Dec 08, 2023 11:59 pm No, this is only to check if the flag is enabled ( didn't see you already solved the problem ). So disregard my last reply.

It is not normal that data is missing. I see in your extended graphs that you have missing data in the last few days ( a large gap from 5 to 7 and few smaller ones ), but last few hours are regular.
Are you referring to the main table data ( alldata ) or the extended table data ( alldataExtra )?
I see you save in your extended table only the UV data, but are unable to see if the data is present.
Yes, I have a data gap between 05/12/23 and 08/12/23, it was the period of change of domain and server, how can I recover this data?

Also by going to phpmyadmin and opening the ALLDATA table, the last row of data is from 24/11/23, but yesterday it was up to 16/11/23, perhaps the data is added to the database every few days?

Re: Problem Php 8.2 homepage admin

Posted: Sat Dec 09, 2023 10:03 am
by davidefa
If you have a backup of the data ( in csv format ) you can import the missing data via the meteootemplate control panel.
Post your csv data and I'll show how to configure the importer.

Regarding the database, new data is added every 5 min to the database, and this new data should appear at the end of the table ( be sure to scroll at the end of the table ).
But even if data is 'mixed' in the database ( I mean not ordered by timestamp, and this may happen for example when importing old data ) the queries to the database always return the right result, i.e. the results are always ordered ( as you can see in your case ).
Moreover, once a day, the database is reordered ( don't know if this is really needed, but it works like that )

Re: Problem Php 8.2 homepage admin

Posted: Sat Dec 09, 2023 1:10 pm
by Cavaliere
davidefa wrote: Sat Dec 09, 2023 10:03 am If you have a backup of the data ( in csv format ) you can import the missing data via the meteootemplate control panel.
Post your csv data and I'll show how to configure the importer.

Regarding the database, new data is added every 5 min to the database, and this new data should appear at the end of the table ( be sure to scroll at the end of the table ).
But even if data is 'mixed' in the database ( I mean not ordered by timestamp, and this may happen for example when importing old data ) the queries to the database always return the right result, i.e. the results are always ordered ( as you can see in your case ).
Moreover, once a day, the database is reordered ( don't know if this is really needed, but it works like that )
Hi Davide,
unfortunately I checked better, the database via phpmyadmin is actually a data hole from 23.45 on 4/12/2023 until 13:00 7/12/2023, attached is the part where there is the hole in the database, can I recover this data via weather underground?

Re: Problem Php 8.2 homepage admin

Posted: Sat Dec 09, 2023 6:25 pm
by davidefa
To check your database I can recommend the 'data quality control' plugin ( helps identifying problems, data inconsistencies... )
If you have a 'WeatheLink Live premium super pro' subscription ( sorry can't understand the davis naming ) you should be able to make a backup from their services.
If not you can use the small utility I've written to extract the data from the wu page ( one day a time ) and convert to csv ( after a small filtering ), once converted you can import in meteotemplate
Usage is simple:
- on the wu page, select the day you want import, the tab 'table'
- select all the table, copy and paste in the edit area of the utility ( wu2csv )
- in the utility select the appropriate date ( which is not included in the data pasted ), and click the button save

wuimport01.png
wuimport01.png (107.03 KiB) Viewed 17391 times

Re: Problem Php 8.2 homepage admin

Posted: Sat Dec 09, 2023 9:25 pm
by Cavaliere
davidefa wrote: Sat Dec 09, 2023 6:25 pm To check your database I can recommend the 'data quality control' plugin ( helps identifying problems, data inconsistencies... )
If you have a 'WeatheLink Live premium super pro' subscription ( sorry can't understand the davis naming ) you should be able to make a backup from their services.
If not you can use the small utility I've written to extract the data from the wu page ( one day a time ) and convert to csv ( after a small filtering ), once converted you can import in meteotemplate
Usage is simple:
- on the wu page, select the day you want import, the tab 'table'
- select all the table, copy and paste in the edit area of the utility ( wu2csv )
- in the utility select the appropriate date ( which is not included in the data pasted ), and click the button save


wuimport01.png
Hi Davide,
Tried it now using your program, but when I go to manually upload the .csv file it gives me errors, is this normal?

I'll attach them below in the screenshot

Re: Problem Php 8.2 homepage admin

Posted: Sat Dec 09, 2023 11:10 pm
by davidefa
I have posted also the import configuration... but I can't see the post ( maybe I forgot to click the submit button after a preview ).
So here the configuration:

import_03_01.png
import_03_01.png (134.67 KiB) Viewed 17379 times
import_03_02.png
import_03_02.png (107.27 KiB) Viewed 17379 times

Re: Problem Php 8.2 homepage admin

Posted: Sat Dec 09, 2023 11:16 pm
by davidefa
No the conversion isn't ok ( the rows do not begin with the date ).
When pasting the data, the first line should start with: Time

P.S.
I updated the script as forgot the conversion of the 'South' direction

wu02.png
wu02.png (37.82 KiB) Viewed 17379 times

This is after the conversion ( 5th of December ):

wu01.png
wu01.png (27.23 KiB) Viewed 17379 times

Re: Problem Php 8.2 homepage admin

Posted: Sun Dec 10, 2023 1:30 pm
by Cavaliere
All resolved, thanks so much for the support Davidefa!!

Re: [RESOLVED] Problem Php 8.2 homepage admin

Posted: Wed Dec 13, 2023 10:11 pm
by Cavaliere
Hi Davide
I just checked on the site and saw that the data imported from wundeground has a totally different layout from that of Meteotemplate, in fact I found some values that were out of line for December. Can I delete these days that we imported entirely, to avoid ruining my statistical data? Or can we solve it some other way?