WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started by: Bunty on March 21, 2018, 12:14:18 PM
-
Are other people having a problem with the river page not loading? I get a error that says:
[20-Mar-2018 22:28:13 America/Chicago] PHP Fatal error: Call to a member function attributes() on null in /home/stillwat/public_html/wx/wxriverdetail.php on line 95
-
Yes, my details are not loading either.
-
Mine is not working either, it was working just about 3 days ago.
-
It looks like the script is no longer downloading the needed data, all of the txt files are empty.
-
I notice that it is working on Dennis's (the creator's) website... http://eastmasonvilleweather.com/wxriverpage.php (http://eastmasonvilleweather.com/wxriverpage.php).
I'll send him a notice and link to this discussion to see if he knows that it has stopped for us.
-
Hey Guys,
Pretty easy fix, need to make the data location a https. Execute as below. It will be found in the river-fetch.php in the River folder.
Currently:
$ch = curl_init("https://water.weather.gov/ahps2/hydrograph_to_xml.php?gage=$riverid&output=xml");
Updated:
$ch = curl_init("http://water.weather.gov/ahps2/hydrograph_to_xml.php?gage=$riverid&output=xml");
I have attached an updated file. Change the extension to .php.
Should fix your issues, I will work on updating my site this weekend.
Thanks,
-Dennis
-
Figures. :oops:
I changed the http to https in about 6-7 different places of the script but forgot about the fetch.php
Should have figured that out with it being the Cron job for the script.
](*,) ](*,) ](*,)
Thanks Dennis.
-
I did the same thing and missed the same one ](*,)
Thanks for the fix Dennis.
Figures. :oops:
I changed the http to https in about 6-7 different places of the script but forgot about the fetch.php
Should have figured that out with it being the Cron job for the script.
](*,) ](*,) ](*,)
Thanks Dennis.
-
Mine stopped working recently too but found by using the code on line 39:
// if the curl does not work
$html = implode(" ", file("http://water.weather.gov/ahps2/hydrograph_to_xml.php?gage=$riverid&output=xml"));
$fp = fopen("river-$riverid.txt", "w");
if ($fp) {
$write = fputs($fp, $html);
fclose($fp);
}
}
Instead of using fetch I started using the code above and it worked again. Never thought of the https being the problem but knew someone would come up with a fix. Thanks for the update Dennis.
-
Thanks Dennis. Out of curiosity is there a chance that you might have the entire script available? I am running a rather old version and would like to get current.
-
Thanks Dennis. Out of curiosity is there a chance that you might have the entire script available? I am running a rather old version and would like to get current.
I'm mobile and don't have it with me but I believe it's available on his website. Just follow the link through his signature and it's in the menu on the far right tab I believe
Sent from my SAMSUNG-SM-G928A using Tapatalk
-
Got it, thanks!
-
Can anyone who is using PHP version 7.2 confirm that this script is working for them?
-
Can anyone who is using PHP version 7.2 confirm that this script is working for them?
Yes it works, if I am referencing the same script.
Although, after I updated from PHP 7.1, to 7.2, A Warning: simplexml_load_file(): appeared. This warning was quickly resolved however.
-
I see that on your page as of just now. I'll bet that if you look at your server's error logs you'll see dozens upon dozens of PHP warnings and notices. With a little help from a friend, I was able to circumvent enough of those to get it to work and at that point I gave up and turned error reporting off.
-
Nothing is showing in my error log, currently.
-
Missing something on my http://tiggrweather.net/wxriverpage.php. Map and headers show but not the table listing. Cron appears to have run once (sorta) but possibly not completely. Server returned...
0 Gauges Near Flood Stage</br>0 Gauges with Minor Flooding</br>0 Gauges with Moderate Flooding</br>0 Gauges with Major Flooding</br>0 Gauges in Action or above</br>Last Update: Monday March 26th, 2018 12:16 PM MST</br>Next Update: Monday March 26th, 2018 04:13 PM MST
...at 1216 today but then nothing else.
Thanks.
-
Missing something on my http://tiggrweather.net/wxriverpage.php. Map and headers show but not the table listing. Cron appears to have run once (sorta) but possibly not completely. Server returned...
0 Gauges Near Flood Stage</br>0 Gauges with Minor Flooding</br>0 Gauges with Moderate Flooding</br>0 Gauges with Major Flooding</br>0 Gauges in Action or above</br>Last Update: Monday March 26th, 2018 12:16 PM MST</br>Next Update: Monday March 26th, 2018 04:13 PM MST
...at 1216 today but then nothing else.
Thanks.
Did you apply the fix Dennis posted above?
-
Did you apply the fix Dennis posted above?
Yes. Actually downloaded the script he posted.
Thanks.
-
Got it. Mine needed $riverstodisable= "0" rather than the default (apparently) 1 setting. Now working.
-
I gave up. Cron ran once Mon night but no more since then.
Thanks anyway, guys.
-
I updated "river-fetch.php" from Dennis's new file but no go. What else has to be edited?
Thanks.
-
Mine is working but lacks the rising.gif.
https://stillwaterweather.com/wx/wxriverpage.php (https://stillwaterweather.com/wx/wxriverpage.php)
-
In my River-Config.php I have this:
$arrowfolder = "/ajax-images"; // The folder where the arrows are located.
In /ajax-images I have three images... rising.gif, falling.gif and steady.gif. These are the arrows.
Check your settings and for the presence of those three images.
-
If Cron isn't working create a download of the river-fetch.php every few hours with your Weather Display software. I have mine to download the file every four hours by using the 'HTTP Download' portion of FTP/Internet Setup and is working fine.
-
Got it running! Thanks Dennis for the update ... \:D/