WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started by: sam2004gp on January 21, 2023, 12:08:20 PM
-
A few of my scripts from SaratogaWX, have stopped working in the last 3 days. I have called my webhost and they are not showing any changes on their end. But appears that the scripts that are puling a "503 Service Unavailable" error all seem to reference something at the NWS. My scripts that are getting the errors are my "refresh" script for "AtomFeed" aka AtomAlerts and my use of his script for NWS forcast script: advforcast2. That can be found on my page here: http://www.mountcrawfordweather.org/forecast.php5 (http://www.mountcrawfordweather.org/forecast.php5)
If anyone has insight I would appreciate it. Keeping up with the changes that happen between webhosts, the NWS, and the fact I have such a low following for my small town, I am thinking of just killing the website all together as it is an expense for me.
-
I think the issue is your PHP version. I suspect it is less than PHP 5.6 and that is causing the issue. I recommend PHP 7 or 8 for sites.
-
So I checked my host control Panel and this script on my website.
http://www.mountcrawfordweather.org/test.php
They both said PHP 5.6.4, so I changed it to 8.1 waited until the host implemented the change, and still things are broken. At this point I went back 5.6.4. I have not made any script or other settings changes in over a year.
Again other PHP scripts on the site work, just not the ones that access stuff at the NWS??????
-
One thing you could do is to change your NWSforecastScript.php5 near the top from
<?php
// error_reporting(E_ALL);
to <?php
error_reporting(E_ALL);
ini_set("display_errors","1");
so we can see what PHP is really griping about to blow up with a 500-Server Error.
Since you aren't running my template set, my diagnostic ability on your site is limited.
-
Ok edited and that is done still getting the same report in the window.
-
And the printable forecast does work. as a straight url.
https://forecast.weather.gov/MapClick.php?lat=38.359&lon=-78.9395&unit=0&lg=english&FcstType=text&TextType=2 (https://forecast.weather.gov/MapClick.php?lat=38.359&lon=-78.9395&unit=0&lg=english&FcstType=text&TextType=2)
-
Ok, still insufficient info. Try uploading the attached as php-check.php5 to your site. It checks for availability of PHP key parts required to run the scripts.
And.. it's likely NOT an NWS issue, but an issue specific to your webserver that's causing the problems.
-
It's there:
http://www.mountcrawfordweather.org/php-check.php (http://www.mountcrawfordweather.org/php-check.php)
-
Ok, looks like missing functions in PHP extensions isn't the problem.
You'll need to check the Apache error_log for your site to see what it says about NWSforecastScript.php5 .. there would be a PHP Fatal Error message or two to further the diagnosis. BTW PHP 5.6.40 is very old, and your NWSforecastScript.php5 is an older copy of advforecast2.php (which should work on PHP 5.6.40)
You can update it to V4.05 at https://saratoga-weather.org/advforecast2-V4.05.php?sce=view
-
I looked via ftp for any error log type files saw none. My hosting is Godaddy. In there Control Panel I did find this, but again no help there.
-
I'm out of remote diagnostic ideas.. this is something your GoDaddy tech support will have to solve. Sorry...
-
Thank You for all your assistance. I am going to give it a few days to see if it clears up on it's own. I called Godaddy today and they claimed all was working well. If it does not clear up, I will beat them over a rock. Like I said all has been working for over a year and then all just went kaput. My first indication was a cron error report on Wednesday for the weather warning scripts.
-
If you haven't already tried, try it with the 7.4 php, if available.
-
I have GoDaddy and I'm running 8.1 PHP with no issues.
FTP into the root/home your site. Look for a file named error_log . That should contain the error messages.
Haven't looked at mine in a long time. My WxStory page is working, but I'm seeing these:
[06-Jan-2023 16:15:12 America/Chicago] PHP Warning: Undefined array key "" in /home/bismarckweather/public_html/wxStory_inc.php on line 554
[06-Jan-2023 16:15:12 America/Chicago] PHP Warning: Trying to access array offset on value of type null in /home/bismarckweather/public_html/wxStory_inc.php on line 554
-
I am running 8.1 and still no luck. Go daddy can't figure it out, and I have my logs files, but still not sure what the problem is.
And yes this is the current error log. No entries for weeks it appears.
-
I took a couple of screen shots of my 8.1 PHP settings. See if you have any different checkboxes. There is also an options window where you select 8.1 to check.
[ You are not allowed to view attachments ] [ You are not allowed to view attachments ]
-
Yep mine are exactly like yours.
-
I am running 8.1 and still no luck. Go daddy can't figure it out, and I have my logs files, but still not sure what the problem is.
And yes this is the current error log. No entries for weeks it appears.
The ancient Curly script AtomAlerts.php has been deprecated quite a while ago (by Curly) and no updates since 2012 -- It's not surprising that it no longer works with PHP over PHP 5.x.
The replacement scripts are nws-alerts.php set and are available in the Saratoga templates. A standalone version (nws-alerts V1.43) is available on GitHub at https://github.com/ktrue/NWS-alerts .
You should replace the AtomAlerts with nws-alerts for PHP versions > 5.x
-
GREAT NEWS!
Well I was checking my website this morning and somehow the scripts are working again. Giving that yesterday it was all still not working. So again it looks like Godaddy was the issue and finally fixed something on their end even though I called them many times and nothing was wrong according to them.
I was actually gearing down to closing my website, as of my account was expiring in a few days. I guess I will check it thru the day and if all is good, I will renew for another year.
Thanks for all your help everyone!