WXforum.net

Weather Related Organizations => WeatherUnderground => Topic started by: gwwilk on August 28, 2020, 02:12:37 PM

Title: wxwuhistory.php Persistent Server Errors
Post by: gwwilk on August 28, 2020, 02:12:37 PM
This script, wxwuhistory.php via its includes script, WU-History-inc.php, regularly generates server errors.  This amounted to over 70 MB in just the last week.

Here's a sample of the errors (sanitized):
Code: [Select]
[28-Aug-2020 12:53:04 America/Chicago] PHP Notice:  A non well formed numeric value encountered in (my Server's home)/WU-History-inc.php on line 1399
[28-Aug-2020 12:53:04 America/Chicago] PHP Notice:  Undefined variable: SERVER in (my Server's home)/WU-History-inc.php on line 397
[28-Aug-2020 12:53:04 America/Chicago] PHP Notice:  A non well formed numeric value encountered in (my Server's home)/WU-History-inc.php on line 1399
[28-Aug-2020 12:54:17 America/Chicago] PHP Notice:  Undefined variable: SERVER in (my Server's home)/WU-History-inc.php on line 397
Any thoughts anyone?  (And, yes, I know.  I should just give up on the current shadow of its former self, WU!)
Title: Re: wxwuhistory.php Persistent Server Errors
Post by: saratogaWX on August 28, 2020, 04:22:38 PM
You might try the Version 3.4g - 27-Apr-2020 from here (https://saratoga-weather.org/WU-History-inc.php?sce=view)

BTW.. the error on 397 was for $SERVER['PHP_SELF'] which should be $_SERVER['PHP_SELF']
Title: Re: wxwuhistory.php Persistent Server Errors
Post by: gwwilk on August 28, 2020, 05:11:07 PM
Thanks very much, Ken!

The latest version works, after suitable customization, and my error log is no longer being populated by running the script.

Much appreciated! [tup]
Title: Re: wxwuhistory.php Persistent Server Errors
Post by: dasman on September 11, 2022, 12:13:08 PM
I have updated my script to 3.4h. I verified all of my settings were customized. I have loaded the new script and my page does not show the data? https://www.peotoneweather.com/wxwuhistory.php (https://www.peotoneweather.com/wxwuhistory.php). If I click on the Comma Delimited File I can see that. It is the Display table that is blank. Any Ideas?
Title: Re: wxwuhistory.php Persistent Server Errors
Post by: saratogaWX on September 12, 2022, 01:53:25 PM
I have updated my script to 3.4h. I verified all of my settings were customized. I have loaded the new script and my page does not show the data? https://www.peotoneweather.com/wxwuhistory.php (https://www.peotoneweather.com/wxwuhistory.php). If I click on the Comma Delimited File I can see that. It is the Display table that is blank. Any Ideas?
I think the issue is in WU-history-inc.php .. a function is returning http as access for the WXDailyHistory.php host for your site, and your site is doing an automatic redirect from http to https.

Try changing
Code: [Select]
   $url  = (false and (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $port == 443) ? "https://" : "http://";
to
Code: [Select]
   $url  = (false and (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $port == 443) ? "https://" : "https://";
to force it to use the https protocol.
Title: Re: wxwuhistory.php Persistent Server Errors
Post by: dasman on September 12, 2022, 07:50:07 PM
Ken you are awesome! That did it. Thank you so much.