Author Topic: Any downside to updating to the latest PHP that my web server provides?  (Read 286 times)

0 Members and 1 Guest are viewing this topic.

Online DaleReid

  • Forecaster
  • *****
  • Posts: 1731
    • Weather at Eau Claire, WI
I got thinking that there have been some updates to the PHP product, and I went to GoDaddy which hosts my Linux server software for my web presence.

I see that I have 5.6 as the version I'm running, and there are more recent versions.

I currently run basically a web page,  but have Meteotemplate, pwsdashboard from Wim van der Kuil, and WDL on it, along with some files I upload and just reference.

At one point I vaguely recall seeing comments that updating to the latest (at that time) version of PHP may cause some problems.

I assume those got ironed out, but is anyone aware of having problems now with updating the PHP on the Linux Server breaking something? 

Should I do the update?

Dale
ECWx.info
&
ECWx.info/t/index.php

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1030
  • BismarckWeather.net
    • BismarckWeather.net
It'll depend on your code.  I'm running mainly Saratoga scripts.  I was on 7.4 version of PHP.  Your message prompted me to check my version as I haven't done that in awhile.
I just updated to 8.0.3.  None of my pages broke.

From a security point of view, the newer the better.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Online DaleReid

  • Forecaster
  • *****
  • Posts: 1731
    • Weather at Eau Claire, WI
Thanks, I appreciate the insight, since I'm not sure why in most instances code updates won't run old code except for security reasons.

I know that all software manufacturers are plagued with the problem of releasing new versions, only to have to patch errors that were previously undiscovered with testing.

I don't think that GoDaddy is beyond 7.6 or so, and again am not sure why they don't adopt the most recent releases, even months later.

Isn't PHP a community/general supported language?  Do commercial places like GoDaddy have to pay to use the interpreter versions?

Dale
ECWx.info
&
ECWx.info/t/index.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8356
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
No, PHP is free to use anywhere as it is released under The PHP License, version 3.01 and Copyright (c) 1999 - 2019 The PHP Group.

The usual issue with PHP version upgrades is the deprecation and eventual removal of built-in functions (sometimes for inscrutable reasons).

Widely used in the past, but now removed:

split()  just replace with explode()
each()  so constructs like
Code: [Select]
while (list($key,$val) = each($array)) { has to change to
Code: [Select]
foreach ($array as $key => $val) {
also more modern versions gripe when you try to use a variable initialized as a string as a number instead.

I've seen these issues exist in older third-party addon PHP scripts.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Online DaleReid

  • Forecaster
  • *****
  • Posts: 1731
    • Weather at Eau Claire, WI
Thanks.

These explanations help me understand (not that anyone else does or does not benefit) and coming from those who use the code every day is helpful.

When I had a part time database programming sideline (remember FoxPro?) new versions that have nixed some functions seem odd.
ECWx.info
&
ECWx.info/t/index.php

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1030
  • BismarckWeather.net
    • BismarckWeather.net
I don't think that GoDaddy is beyond 7.6 or so, and again am not sure why they don't adopt the most recent releases, even months later.
I'm on GoDaddy's shared hosting.  Version 8 is there.  Must have popped up in the past couple of months.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI