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 4017) - 17 March 2024

Legacy Cumulus 1 release v1.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

HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

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

Moderator: daj

RayProudfoot
Posts: 3372
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:

HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by RayProudfoot »

My new webhost - HostPresto - have written to me advising PHP will be updated from 5.6 to 7.2 WEF 10:00 25 November.

They have included instructions on how to test if my webpages will still work but this is outside my comfort zone.

The biggest PHP script I use is beteljuice's Data Summary PHP but there are also smaller ones. One on my home page calculates local noon from sunrise and sunset times.

I know there are others with HostPresto so any info will benefit them too.
Cheers,
Ray, Cheshire.

Image
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by saratogaWX »

Two changes may be problematic for older PHP scripts:

1) the split() function is removed in 7.x -- replace it with the explode() function.
2) any preg_*() functions that use the /e (execute) modifier have to be rewritten to use the callback method.

If your scripts are up to current versions (for Saratoga templates/scripts), they will work fine with 7.2
RayProudfoot
Posts: 3372
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: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by RayProudfoot »

I should have mentioned I’m running Cumulus1 so PHP is limited.

I’m sorry but most of what you wrote flew over the top of my head. I was hoping for a quiet spell after having to switch hosts. I suppose I could just wait until Monday and then check if everything works.
Cheers,
Ray, Cheshire.

Image
RayProudfoot
Posts: 3372
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: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by RayProudfoot »

I had another read of their letter and switching temporarily to PHP 7.2 was quite easy. The bad news is beteljuice's excellent data summary script doesn't work as the page remains blank. The only other script that I can spot with a problem is the calculation of local noon on my home page. http://www.cheadlehulmeweather.co.uk/index.htm

They do say the user can stay with 5.6 if going to a different version breaks things. In the absence of advice to the contrary that might be my safest option.
Cheers,
Ray, Cheshire.

Image
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by saratogaWX »

If you can post both of the scripts with problems (as .txt or .zip files), I can take a look and make needed changes for PHP 7.2.
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by BCJKiwi »

@ Ray
Don't know which version of Beteljuice's Datasummary script you are using but the curent one works fine in PHP 5.x and 7.2.x (currently on 7.2.10-dev server & 7.2.9- public server)
I know, I have tested it extensively in multiple versions of 7.2 and with multiple browsers. There are some variations in the 'look' with some browsers, notably Chrome treats some css effects differently and not fo rthe better!
RayProudfoot
Posts: 3372
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: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by RayProudfoot »

That's very kind of you, thanks. I'm attaching two files. CheadleHulme.zip contains my home page. The bit of code that needs changing refers to SunTransit for calculating local noon.

I'm attaching the original beteljuice.zip file as there are many php files and I don't know which need changing. A bit of a cheek I know but it might be worth bringing this to beteljuice's attention as much of it is his code and there's no point changing it for one user.

Once again, I'm very grateful. :clap:
You do not have the required permissions to view the files attached to this post.
Cheers,
Ray, Cheshire.

Image
RayProudfoot
Posts: 3372
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: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by RayProudfoot »

BCJKiwi wrote: Tue 20 Nov 2018 7:51 pm @ Ray
Don't know which version of Beteljuice's Datasummary script you are using but the curent one works fine in PHP 5.x and 7.2.x (currently on 7.2.10-dev server & 7.2.9- public server)
I know, I have tested it extensively in multiple versions of 7.2 and with multiple browsers. There are some variations in the 'look' with some browsers, notably Chrome treats some css effects differently and not fo rthe better!
Now you have me baffled. I downloaded the file he made available and made the necessary changes for it to wotk with my site. I'm using Firefox v63.0.3 to view my pages.

I've attached it to the message above. Perhaps that will help.
Cheers,
Ray, Cheshire.

Image
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by saratogaWX »

The beteljuice issue was easily solved.. it has to do with stricter enforcement of variable types in assignments. Only two lines needed changing in betel_readDayfile.php:

Line 741 which read

Code: Select all

    $alltime = array(1 => '', 2 => '', 3 => '', 4 => '', 6 => '', 7 => '', 8 => '', 9 => '', 10 => '', 11 => '', 12 => '');
needs change to

Code: Select all

    $alltime = array(1 => array(), 2 => array(), 3 => array(), 4 => array(), 6 => array(), 7 => array(), 8 => array(), 9 => array(), 10 => array(), 11 => array(), 12 => array());
to properly initialize the variable.

Line 904 was

Code: Select all

        $seasonTot = array(0 => '', 1 => '', 2 => '', 3 => '');
needs change to

Code: Select all

        $seasonTot = array(0 => array(), 1 => array(), 2 => array(), 3 => array());
for the same reason.

I didn't find any php errata in your homepage html.. what error message was displayed?
RayProudfoot
Posts: 3372
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: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by RayProudfoot »

That’s great, many thanks. I can change those tomorrow and test.

The local noon field was just blank after switching PHP versions. I think it may have changed the .htaccess file because when I reverted to 5.6 that field remained blank.

I fixed it by uploading a local copy of .htaccess that HostPresto changed for me when I switched to them.

Might .htaccess also need changing?
Cheers,
Ray, Cheshire.

Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by beteljuice »

As stated above, latest dayfile reader should work "out-of-the-box", perhaps you missed an update, especially as many were for php7 tweaks.
Image
......................Imagine, what you will KNOW tomorrow !
RayProudfoot
Posts: 3372
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: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by RayProudfoot »

I thought I had the latest files. Perhaps not. But I still have a problem with a piece of code on my home page that calculates local noon. I suspect it's connected to my htaccess file as it didn't work when I first switched to HostPresto.

But they tweaked it and then the code worked. But after briefly switching to php v7.2 and then back the local noon code was broken again and was onyl fixed when I uploaded the original htaccess file. That is the one I'm attaching. Does it look compatible with php 5.6 and 7.2?
You do not have the required permissions to view the files attached to this post.
Cheers,
Ray, Cheshire.

Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by beteljuice »

That's saying (I think) php7.0 is being applied not only to php files, but also .htm and .html

What version are you saying the file now works under ?
Image
......................Imagine, what you will KNOW tomorrow !
RayProudfoot
Posts: 3372
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: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by RayProudfoot »

beteljuice, everything works with 6.5 and the attached .htaccess file.

Switching to PHP 7.2 results in your datasummary page remaining blank and local noon code not returning a time. I suspect switching to a different PHP version changes my .htaccess file.

http://www.cheadlehulmeweather.co.uk/be ... ummary.php
Cheers,
Ray, Cheshire.

Image
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: HostPresto changing PHP from 5.6 to 7.2 - will this stop scripts working?

Post by BCJKiwi »

The changes SaratogaWX advised are already in the version I have (7.1 October 2018).

So if you have the latest then you should be OK.
Post Reply