Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

PHP code has stopped calculating Local Noon overnight

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

RayProudfoot
Posts: 3389
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

PHP code has stopped calculating Local Noon overnight

Post by RayProudfoot »

Last October I switched from Steve's hosting to HostPresto and since then they've been absolutely fine. I have a small piece of PHP code supplied by a Cumulus member that calculates local noon and inserts the time into the relevant place with Sunrise and Sunset times. www.cheadlehulmeweather.co.uk

I have contacted HostPresto and they confirm PHP 5.6 is still running which that code requires. Can anyone offer a clue as to why this code has stopped running overnight please? I have rebooted the netbook running Cumulus but the problem remains.

I'm attaching the htaccess file from the server.
You do not have the required permissions to view the files attached to this post.
Cheers,
Ray, Cheshire.

Image
RayProudfoot
Posts: 3389
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by RayProudfoot »

HostPresto suggested performing a restore. I restored just the public_html folder from Saturday and that has fixed the problem.

The betel phpsummary page is blank but I assume that will be fixed when the daily update is performed just after midnight. Phew!
Cheers,
Ray, Cheshire.

Image
RayProudfoot
Posts: 3389
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by RayProudfoot »

I can't understand why my datasummary pages aren't displaying. Looking back to August last year when I set them up I didn't have to wait until midnight for the pages to show.

Although I've performed a restore on my public_html files I can't see why the datasummary page isn't loading. Can anyone assist please?
Cheers,
Ray, Cheshire.

Image
freddie
Posts: 2471
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by freddie »

If you look in your server error log you might find some clues there.
Freddie
Image
freddie
Posts: 2471
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by freddie »

Just tried looking at the PHP source code and got this:

Code: Select all

Tough ! - I changed the password !!!
:-(
Freddie
Image
RayProudfoot
Posts: 3389
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by RayProudfoot »

Thanks Freddie. I’m sure I haven’t changed the password. I’ll check the error log, thanks.
Cheers,
Ray, Cheshire.

Image
RayProudfoot
Posts: 3389
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by RayProudfoot »

freddie wrote: Mon 25 Feb 2019 12:43 pm Just tried looking at the PHP source code and got this:

Code: Select all

Tough ! - I changed the password !!!
:-(
Hi Freddie,

Looking at the error log there is only one entry which I'm guessing might be your attempted access...

[Mon Feb 25 12:42:27.147951 2019] [access_compat:error] [pid 1650739:tid 47337252718336] [client 40.117.171.139:54493] AH01797: client denied by server configuration: /home/cheadleh/public_html/xmlrpc.php
Cheers,
Ray, Cheshire.

Image
freddie
Posts: 2471
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by freddie »

RayProudfoot wrote: Mon 25 Feb 2019 1:18 pmMon Feb 25 12:42:27.147951 2019] [access_compat:error] [pid 1650739:tid 47337252718336] [client 40.117.171.139:54493] AH01797: client denied by server configuration: /home/cheadleh/public_html/xmlrpc.php
Can you list that file? Looks like a potential permissions problem. Going by the name of the file, it probably calls another URL (possibly to pick up data) and your server's config is stopping that happening.
Freddie
Image
RayProudfoot
Posts: 3389
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by RayProudfoot »

freddie wrote: Mon 25 Feb 2019 1:30 pm Can you list that file? Looks like a potential permissions problem. Going by the name of the file, it probably calls another URL (possibly to pick up data) and your server's config is stopping that happening.
I looked in that location but couldn't find a file with that name - /home/cheadleh/public_html/xmlrpc.php

I've raised a ticket so let's see what they say. Very odd when nothing has changed except data uploads. Appreciate your help Freddie. :)
Cheers,
Ray, Cheshire.

Image
Mapantz
Posts: 1807
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by Mapantz »

You might need to go in to the PHP settings, click 'switch to PHP options' and make sure 'allow_url_fopen' is set to on.
Image
RayProudfoot
Posts: 3389
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by RayProudfoot »

I checked but I can't see that option. HostPresto are going to restore as everything seemed okay yesterday.

These are the options available to me.
PHP_Settings.png
You do not have the required permissions to view the files attached to this post.
Cheers,
Ray, Cheshire.

Image
RayProudfoot
Posts: 3389
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by RayProudfoot »

Problem has been resolved by HP restoring betel_datasummary.php from the backup. I thought that would have been done when I did the restore but clearly there's a right way and wrong way and I did it the wrong way. :D Appreciate the help.
Cheers,
Ray, Cheshire.

Image
RayProudfoot
Posts: 3389
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by RayProudfoot »

The Local Noon problem has resurfaced again this afternoon. HostPresto have restored index.htm but despite trying various versions of PHP have been unable to resolve the problem.

This code was kindly given to me by a user here on Cumulus but I've forgotten his name. It's pretty simple really. Take the sunrise and sunset times and find the mid-point. That is stored in a variable called $suntransit which is then put into indexT.htm on my installation of Cumulus from where it is processed and the resultant file uploaded to the webhost.

Host Presto have asked for it to be checked and ask what version of PHP it is compatible with. Here is the code in indexT.htm

// Calculate Noon from Cumulus SR & SS */
error_reporting(0);
date_default_timezone_set("Europe/London");
$sr = "<#sunrise>";
$ss = "<#sunset>";
$sr = strtotime($sr);
$ss = strtotime($ss);
$dl = (($ss - $sr)/2 + $sr);
$suntransit = date("H:i", $dl);
?>

and this is where it is stored for display purposes...

<tr>
<td class="labels">Dusk:</td>
<td class="site_data" style="text-align: left;"><#dusk></td>
<td class="labels">Local Noon:</td>
<td class="site_data" style="text-align: left;"> <?php echo $suntransit; ?></td>
</tr>

Can anyone see any reason why that would not run with PHP v5.1 or later?
Cheers,
Ray, Cheshire.

Image
RayProudfoot
Posts: 3389
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by RayProudfoot »

I've finally got to the bottom of this problem and have asked HostPresto to help fix it.

I have two .htaccess files in public_html but with slightly different names.

.htaccess and .htaccess_

One is required for the DataSummary pages to be displayed. The other is required for Local Noon to be calculated. The one with the _ has to have that character removed to run.

Hopefully they can be merged into a single file to ensure both actions can be performed.

I don't know enough about PHP to do the edit myself. Best left to those who know what they're doing.
Cheers,
Ray, Cheshire.

Image
Mapantz
Posts: 1807
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: PHP code has stopped calculating Local Noon overnight

Post by Mapantz »

Change error_reporting(0); to error_reporting(1); and see if any errors pop up.

What is the actual problem Ray?
Image
Post Reply