WXforum.net

Web Weather => Weather Web Site Help => Topic started by: mkutche on November 28, 2021, 10:08:24 AM

Title: New host, getting this error.
Post by: mkutche on November 28, 2021, 10:08:24 AM
Now I know I need to update a few things but i switched servers and getting this, before i switched servers everything worked...

Quote
Fatal error: Uncaught Error: Call to undefined function gregoriantojd() in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php:1765 Stack trace: #0 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php(1473): calcMoonRiSet->getJulianDate(1638075600) #1 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php(1452): calcMoonRiSet->setDate('2021', '11', '28') #2 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php(516): calcMoonRiSet->__construct('39.298080', '-86.699142', 'America/Indiana...') #3 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/ajax-dashboard.php(303): getUSNOsunmoon() #4 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/wxindex.php(98): include_once('/hermes/walnacw...') #5 {main} thrown in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php on line 1765

www.gosportwx.com
Title: Re: New host, getting this error.
Post by: mkutche on November 28, 2021, 11:23:27 AM
Now I know I need to update a few things but i switched servers and getting this, before i switched servers everything worked...

Quote
Fatal error: Uncaught Error: Call to undefined function gregoriantojd() in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php:1765 Stack trace: #0 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php(1473): calcMoonRiSet->getJulianDate(1638075600) #1 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php(1452): calcMoonRiSet->setDate('2021', '11', '28') #2 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php(516): calcMoonRiSet->__construct('39.298080', '-86.699142', 'America/Indiana...') #3 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/ajax-dashboard.php(303): getUSNOsunmoon() #4 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/wxindex.php(98): include_once('/hermes/walnacw...') #5 {main} thrown in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php on line 1765

www.gosportwx.com

I deleted the file until I can get an answer to the solution
Title: Re: New host, getting this error.
Post by: mkutche on November 28, 2021, 10:40:01 PM
Now I know I need to update a few things but i switched servers and getting this, before i switched servers everything worked...

Quote
Fatal error: Uncaught Error: Call to undefined function gregoriantojd() in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php:1765 Stack trace: #0 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php(1473): calcMoonRiSet->getJulianDate(1638075600) #1 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php(1452): calcMoonRiSet->setDate('2021', '11', '28') #2 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php(516): calcMoonRiSet->__construct('39.298080', '-86.699142', 'America/Indiana...') #3 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/ajax-dashboard.php(303): getUSNOsunmoon() #4 /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/wxindex.php(98): include_once('/hermes/walnacw...') #5 {main} thrown in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/get-USNO-sunmoon.php on line 1765

www.gosportwx.com

anyone know how to fix this error? jw right now i currently deleted it (get-USNO-sunmoon.php) from server until i can get someone to help me fix it. I didn't change anything on it not sure why it popped up with error.
Title: Re: New host, getting this error.
Post by: Jasiu on November 29, 2021, 10:06:00 AM
From a first glance, it looks like your host doesn't support the Gregorian to Julian PHP call (I don't know why it wouldn't, though). What version PHP are you running?

If you unzip and put the attached file into the root directory of your site and run it, it'll allow us to get a thorough dump of the PHP that's running.

Title: Re: New host, getting this error.
Post by: mkutche on November 29, 2021, 12:44:36 PM
Itís running php 7.4.. I will unzip and upload when I get off work and reply here thanks
Title: Re: New host, getting this error.
Post by: saratogaWX on November 29, 2021, 01:47:05 PM
The PHP plugin for calendar functions wasn't enabled:

Quote
o get these functions to work, you have to compile PHP with --enable-calendar.

Ask your hoster to fix that issue.
Title: Re: New host, getting this error.
Post by: mkutche on November 29, 2021, 03:48:38 PM
The PHP plugin for calendar functions wasn't enabled:

Quote
o get these functions to work, you have to compile PHP with --enable-calendar.

Ask your hoster to fix that issue.

is that found in the php.ini?
Title: Re: New host, getting this error.
Post by: saratogaWX on November 29, 2021, 04:16:34 PM
No, it's a compile option when the php.exe file is being generated.  https://www.php.net/manual/en/ref.calendar.php

It should be a part of all commercial PHP installations.  Ask your hoster to fix the php.exe by recompiling and add the --enable-calendar option.

Title: Re: New host, getting this error.
Post by: mkutche on November 29, 2021, 06:19:54 PM
No, it's a compile option when the php.exe file is being generated.  https://www.php.net/manual/en/ref.calendar.php

It should be a part of all commercial PHP installations.  Ask your hoster to fix the php.exe by recompiling and add the --enable-calendar option.

Patiently waiting for my host to fix this.. have a question advforecast2.php seems like it doesn't want to auto update is calendar issue the reason why it doesn't want to auto update?
Title: Re: New host, getting this error.
Post by: saratogaWX on November 29, 2021, 07:34:52 PM
You're using the V4.05 of advforecast2.php (screen scraper for weather.gov point-printable forecast).  It does seem to be working with current data... what are the symptoms around the possible failure to auto update?  Does it happen at a similar time of day?  What does the script show when it happens ( via a view-source of the wxforecast.php?force=1 page)?
Title: Re: New host, getting this error.
Post by: mkutche on November 29, 2021, 07:43:08 PM
You're using the V4.05 of advforecast2.php (screen scraper for weather.gov point-printable forecast).  It does seem to be working with current data... what are the symptoms around the possible failure to auto update?  Does it happen at a similar time of day?  What does the script show when it happens ( via a view-source of the wxforecast.php?force=1 page)?

That it wasn't updated as of 1:15am this morning, I just did a ?force=1 and it updates it by force.
Title: Re: New host, getting this error.
Post by: saratogaWX on November 29, 2021, 09:46:19 PM
The advforecast2.php script has
Code: [Select]
$refreshTime = 600; // default refresh of cache 600=10 minutes so it should try to refresh the cache file every 10 minutes.  That is more than enough as the forecasts are only updated about 4 times a day currently.
Title: Re: New host, getting this error.
Post by: mkutche on November 30, 2021, 10:02:53 AM
What does get-UNSO-sunmoon.php do? It seemed to be working fine without it and noticed everything was updating correctly since we last spoke

My host is slowly working on it I think.. said it could take 24-48hrs
Title: Re: New host, getting this error.
Post by: saratogaWX on November 30, 2021, 10:21:04 AM
get-USNO-sunmoon.php will provide calculated moonrise/moonset, %illumination and moonphase info for all weather software except Weather-Display (which natively calculates those).  You can temporarily rename get-USNO-sunmoon.php to another name and the template will use some rough calculations about moonphase/%illumination, but not show moonrise/moonset times.

The moon details are shown in the dashboard (on the homepage), and in the wxastronomy.php page.

Getting the calendar functions back into php is the preferred method to allow the calculations in get-USNO-sunmoon.php to function.
Title: Re: New host, getting this error.
Post by: mkutche on November 30, 2021, 05:12:24 PM
get-USNO-sunmoon.php will provide calculated moonrise/moonset, %illumination and moonphase info for all weather software except Weather-Display (which natively calculates those).  You can temporarily rename get-USNO-sunmoon.php to another name and the template will use some rough calculations about moonphase/%illumination, but not show moonrise/moonset times.

The moon details are shown in the dashboard (on the homepage), and in the wxastronomy.php page.

Getting the calendar functions back into php is the preferred method to allow the calculations in get-USNO-sunmoon.php to function.

Looks like they got it working! Thanks for your help Ken! :)
Title: Re: New host, getting this error.
Post by: mkutche on December 01, 2021, 05:14:16 AM
Sorry to bug again but now I'm getting this error..

Quote
Notice: Undefined offset: 0 in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/ajax-dashboard.php on line 936

seemed to of fixed itself? lol
Title: Re: New host, getting this error.
Post by: saratogaWX on December 01, 2021, 11:26:47 AM
Your line 936 in your modified ajax-dashboard.php is
Code: [Select]
<?php echo get_UVrange($UVfcstUVI[$UVptr]); ?>
The error message said that $UVfcstUVI[0] was not set .. likely there was an issue between your website and temis.nl that prevented get-UV-forecast.php from properly initializing that variable.  It fixed itself when the data was again available from temis.nl for the UV forecasts.