Author Topic: Error in WU-forecast.php  (Read 327 times)

0 Members and 1 Guest are viewing this topic.

Offline LeFuet

  • Member
  • *
  • Posts: 15
Error in WU-forecast.php
« on: June 22, 2018, 03:44:52 AM »
How do I get rid of this error, I can not remember that I changed something there:
Warning: Division by zero at /var/www/vhosts/euro-picture.de/httpdocs/wetterstation/cumulus/WU-forecast.php on line 638

www.wetter.euro-picture.de


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6666
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #1 on: June 22, 2018, 11:28:46 AM »
It is caused by the URL you selected for the default forecast - it is incomplete (missing lat,long)

Change it to
Code: [Select]
https://www.wunderground.com/weather/de/hiltenfingen/48.1535502%2C10.6805879 and the script should work fine.

Any of the wunderground urls that are of the format /weather/{country}/{city} require a /{latitude},{longitude} to be used with the script.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline LeFuet

  • Member
  • *
  • Posts: 15
Re: Error in WU-forecast.php
« Reply #2 on: June 22, 2018, 11:48:53 AM »
even after modification, the error remains

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6666
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #3 on: June 22, 2018, 01:05:49 PM »
I'm not sure you made the change effective.  Your Settings.php still has
Code: [Select]
'Hiltenfingen|https://www.wunderground.com/weather/de/hiltenfingen', //Hiltenfingen, Deutschland
and needs to have
Code: [Select]
'Hiltenfingen|https://www.wunderground.com/weather/de/hiltenfingen/48.1535502%2C10.6805879', //Hiltenfingen, Deutschland

That is why the error persists.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline LeFuet

  • Member
  • *
  • Posts: 15
Re: Error in WU-forecast.php
« Reply #4 on: June 22, 2018, 02:17:06 PM »
Thank you for your help

recards
« Last Edit: June 22, 2018, 02:20:51 PM by LeFuet »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6666
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #5 on: June 22, 2018, 02:22:45 PM »
I would suggest changing both.  The first entry in the $SITE['WUforecasts'] = array( will override the contents of the $SITE['fcsturlWU'] entry, but having them the same is still a good idea.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6666
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #6 on: June 22, 2018, 03:30:03 PM »
Also, you need to install the icons used for the forecast .. download https://saratoga-weather.org/saratoga-icons2.zip

Unzip to your document root and upload the entire forecast/ set of directories and images to your website so that you have
./forecast
./forecast/images
./forecast/icon-templates
DualImage.php

all in your document root.  Yes, the upload may take a while.. there are a lot of images to upload.
« Last Edit: June 22, 2018, 03:31:49 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline LeFuet

  • Member
  • *
  • Posts: 15
Re: Error in WU-forecast.php
« Reply #7 on: June 22, 2018, 07:28:47 PM »
Thank you very much, it looks very good so far! I could not have done that without you!

Best regards
Harry

Offline bianconero57

  • Member
  • *
  • Posts: 28
    • Valdefensch@57
Re: Error in WU-forecast.php
« Reply #8 on: July 14, 2018, 11:13:03 AM »
good evening
i join the thread I can not run the script WU for forecasts
http://seremange-meteolive.franceserv.com/realtime/wxindex.php

Forecast blank? Force Update !
http://seremange-meteolive.franceserv.com/realtime/wxforecast.php

thanks in advance
kind regards

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6666
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #9 on: July 14, 2018, 11:22:54 AM »
I think you have an incorrect URL for the WU-forecast.php script.

Change
Code: [Select]
https://www.wunderground.com/weather/fr/ser%C3%A9mange-erzange/49.32C6.09 to
Code: [Select]
https://www.wunderground.com/weather/fr/ser%C3%A9mange-erzange/49.32%2C6.09 and it should work fine.

Note: after the change, you may have to do ?force=1 to refresh the cache to see the change in effect.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline bianconero57

  • Member
  • *
  • Posts: 28
    • Valdefensch@57
Re: Error in WU-forecast.php
« Reply #10 on: July 15, 2018, 09:56:36 AM »
 =D> thank you solved with the good url and also by downloading the latest update of WU-forecast.php to try to solve the problem of cache files without forecast information
kind regards

 

anything