Author Topic: Php 8.1  (Read 3115 times)

0 Members and 1 Guest are viewing this topic.

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Php 8.1
« on: April 11, 2023, 09:54:20 AM »
Hi, my web host changed my php version to 8.1 last night and my dashboard is blank. I was wondering if anyone else had this issue and what can be done? I have done all the updates.
Thank you!
Www.JupiterWX.com
« Last Edit: April 11, 2023, 09:58:43 AM by JupiterJoe »

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #1 on: April 11, 2023, 05:10:12 PM »
I reverted the php back to 7.4 for the time being. I’d still love to hear any advice you may have. Thank you. :)

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 748
    • Lake Huron Weather
Re: Php 8.1
« Reply #2 on: April 11, 2023, 06:41:30 PM »
I switched to 8.1 and did all the updates and my site has been working fine, just for reference.
CW3699

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9405
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Php 8.1
« Reply #3 on: April 11, 2023, 07:38:48 PM »
The older versions of AltAjaxDashboardConfig6.php had two 'naked' constants (which cause a PHP Fatal error in PHP8)

Change
Code: [Select]
$month = $today[month];
$day = $today[mday];
to
Code: [Select]
$month = $today["month"];
$day = $today["mday"];
to fix the issue.

The 4 other scripts in the alternative dashboard also need to be updated from the 6.95h distribution:
cloud-base.php
get-aqi-rss.php
heavens.php
raintodate.php
in addition to ajax-dashboard6.php itself.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #4 on: April 11, 2023, 08:07:11 PM »
Thank you. I always update your scripts, but I overlooked the alt dashboard scripts. Thank you for letting me know, I’ll look into it. :)

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #5 on: April 12, 2023, 11:36:16 AM »
Well, I did it, but now I'm getting some strange errors.
Thank you for any insight, I'm not sure where I went wrong here:
https://www.joe4speed.com/wxindex.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9405
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Php 8.1
« Reply #6 on: April 12, 2023, 03:13:05 PM »
Now it is a WD setting that needs to be changed.  The testtags.php should not have units included with the weather variables.

Use the Weather-Display Control Panel,
Web Files/Web Page/Real Time FTP/WDL,
Custom Web Page Setup TAB

Untick: "Include the Units used"
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #7 on: April 13, 2023, 06:47:20 AM »
Thank you, that fixed that problem. I wonder why that happened, I never touched WD before doing all of this.
I have the php 8.1 running now.
I have a couple more little issues if you might be able to advise me:
The SPC map doesn’t show any more.
I can’t seem to get the webcam picture to show like it used to where current conditions are.
The cloud level graphic says clientraw not available.
And there are some more php errors towards the bottom which are odd. (To me)
Thank you so much!
« Last Edit: April 13, 2023, 09:28:50 AM by JupiterJoe »

Offline hcorrin

  • Senior Contributor
  • ****
  • Posts: 152
    • Ballaugh Weather
Re: Php 8.1
« Reply #8 on: April 13, 2023, 11:46:36 AM »
Suggest you double check lines 154 and 156 in cloud base.php that the paths are correct

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9405
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Php 8.1
« Reply #9 on: April 13, 2023, 01:41:11 PM »
For the messages at the bottom of the page, just set WXSIM to do a 5 day forecast instead of a 4 day forecast.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #10 on: April 13, 2023, 03:20:19 PM »
Suggest you double check lines 154 and 156 in cloud base.php that the paths are correct
Nope, the url points to the correct destination.

For the messages at the bottom of the page, just set WXSIM to do a 5 day forecast instead of a 4 day forecast.
Thank you, that worked.

Would you have any idea why the SPC map adds A strange url to the image? "https://www.joe4speed.com/ajax-dashboard6-V6.95h/https://www.spc.noaa.gov/products/activity_loop.gif" Maybe that's why it doesn't show any more? It seems to want to point a lot at folder ajax-dashboard6-V6.95h, but I never specified that folder for anything.

All of this stuff worked on the older version, all I did was coppy the different settings to the new version and things are strange.
« Last Edit: April 13, 2023, 03:24:52 PM by JupiterJoe »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9405
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Php 8.1
« Reply #11 on: April 13, 2023, 03:31:14 PM »
So the cloud-base.php issue is the specification for the clientraw/clientrawextra as
Code: [Select]
$clientraw   = 'https://joe4speed.com/clientraw.txt';      // relative file address for WD clientraw.txt
#$clientraw   = 'https://saratoga-weather.org/weewx/clientraw.php';
$clientextra = 'https://www.joe4speed.com/clientrawextra.txt'; // relative file address for WD clientrawextra.txt
  that has to be FILE addresses, not URLs like
Code: [Select]
$clientraw   = './clientraw.txt';      // relative file address for WD clientraw.txt
#$clientraw   = 'https://saratoga-weather.org/weewx/clientraw.php';
$clientextra = './clientrawextra.txt'; // relative file address for WD clientrawextra.txt

For the SPC map display, change ajax-dashboard6.php from
Code: [Select]
<img src="../ajax-dashboard6-V6.95h/<?php echo $spc_img?>" alt="SPC Activity Map" to
Code: [Select]
<img src="<?php echo $spc_img?>" alt="SPC Activity Map"
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #12 on: April 13, 2023, 03:45:16 PM »
So the cloud-base.php issue is the specification for the clientraw/clientrawextra as
Code: [Select]
$clientraw   = 'https://joe4speed.com/clientraw.txt';      // relative file address for WD clientraw.txt
#$clientraw   = 'https://saratoga-weather.org/weewx/clientraw.php';
$clientextra = 'https://www.joe4speed.com/clientrawextra.txt'; // relative file address for WD clientrawextra.txt
  that has to be FILE addresses, not URLs like
Code: [Select]
$clientraw   = './clientraw.txt';      // relative file address for WD clientraw.txt
#$clientraw   = 'https://saratoga-weather.org/weewx/clientraw.php';
$clientextra = './clientrawextra.txt'; // relative file address for WD clientrawextra.txt


So I originally had it set that way and it still didn't work. When I change it back, it shows the cloud graphic for a minute then changes back to clientraw not found. Refreshing the page loses it.

Can you tell why it wants to point everything to "ajax-dashboard6-V6.95h" folder? I had to create that folder to point all the graphics to, because the graphics wanted to go there instead of the root folder like before? This seems to be a big part of my problem is that the script wants to point to a folder that I never created instead of what was there before. The "Rain Today" rain graph points to that folder too, so the image doesn't show, and I never specified that. Is there a global setting somewhere that defaults to a "ajax-dashboard6-V6.95h" folder?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9405
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Php 8.1
« Reply #13 on: April 13, 2023, 04:50:38 PM »
Settings.php has $SITE['imagesDir'] that points to where the images are.  Should contain ./ajax-images/ (which is correct).

Looking at your copy of ajax-dashboard6.php?sce=view shows 16 instances that has
Code: [Select]
../ajax-dashboard6-V6.95h/ in the <img src="... statements.  I suspect that a global replace you did at some time changed the
Code: [Select]
{$imagesDir} to the bogus value.
The best way to fix that is likely to use ajax-dashboard6.php from the 6.95h distribution.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #14 on: April 13, 2023, 06:36:17 PM »
I think these must be written this way originally since I never had that folder. I had to create it to move images to because they wanted to go to that folder after the switch.

I got the cloud graphic to work by changing:
Code: [Select]
<img src="../ajax-dashboard6-V6.95h/cloud-base.php?alt=<?php echo $cloudheightmeters?>m" alt="" title="<?php echo $cloudheightmeters?>m ASL" height="200" width="90" /></span>
to:
Code: [Select]
<img src="../cloud-base.php?alt=<?php echo $cloudheightmeters?>m" alt="" title="<?php echo $cloudheightmeters?>m ASL" height="200" width="90" /></span>

I'm really not sure where "ajax-dashboard6-V6.95h" came from, but thank you so much for helping me track all of this down. I do appreciate your time.

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #15 on: April 15, 2023, 12:50:47 AM »
The saga continues. Yesterday all was well. No errors. Today is a different story. I’m getting these errors now:
Code: [Select]
Warning: Undefined array key 1 in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 60

Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 60

Warning: Undefined array key 2 in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 61

Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 61

Warning: Undefined array key 3 in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 62

Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 62

Lightning page shows up blank too: https://www.joe4speed.com/wxajaxlight.php

Oh boy, what am I doing wrong here? I Haven’t touched anything since all was well yesterday. :(

Offline hcorrin

  • Senior Contributor
  • ****
  • Posts: 152
    • Ballaugh Weather
Re: Php 8.1
« Reply #16 on: April 15, 2023, 04:37:42 AM »
Hi the aqi is not being received hence the errors they usually disappear when your site can get the data this is a problem at the aqi end not your web site
Can you access the the lightning web site you cannot see on you page

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #17 on: April 15, 2023, 11:24:20 AM »
That’s odd, is there any way to suppress those errors?

No, I still can’t see the lightning page.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9405
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Php 8.1
« Reply #18 on: April 15, 2023, 12:27:02 PM »
The saga continues. Yesterday all was well. No errors. Today is a different story. I’m getting these errors now:
Code: [Select]
Warning: Undefined array key 1 in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 60

Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 60

Warning: Undefined array key 2 in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 61

Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 61

Warning: Undefined array key 3 in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 62

Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /home/robleh6/joe4speed.com/get-aqi-rss.php on line 62

Lightning page shows up blank too: https://www.joe4speed.com/wxajaxlight.php

Oh boy, what am I doing wrong here? I Haven’t touched anything since all was well yesterday. :(

The get-aqi-rss.php script doesn't have much in error checking built-in.  You do need to change
Code: [Select]
$urlRealtime = "http://feeds.enviroflash.info/rss/realtime/134.xml";  //San Jose, CA - Current Air Quality
to point to YOUR AQI source .. the default one is for San Jose, CA (mine).
You can suppress errors by adding
Code: [Select]
error_reporting(0); after that line in the script.  It seems your webserver had issues getting the data from feeds.enviroflash.info, but is showing data now.

Regarding wxajaxlight.php, there's likely an included script in the main-copy section that is blowing up with a Fatal PHP error.  Can't tell what that might be remotely.  Please attach the wxajaxlight.php page along with any include/require scripts in the main-copy section of the page, and I'll take a look.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #19 on: April 16, 2023, 08:29:49 AM »
Thank you, I'll check it out.
Here is the wxajaxlight.php script:
Code: [Select]
<?php
############################################################################
# A Project of TNET Services, Inc. and Saratoga-Weather.org (WD-USA template set)
############################################################################
#
#   Project:    Sample Included Website Design
#   Module:     sample.php
#   Purpose:    Sample Page
#   Authors:    Kevin W. Reed <kreed@tnet.com>
#               TNET Services, Inc.
#
Copyright: (c) 1992-2007 Copyright TNET Services, Inc.
############################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
############################################################################
# This document uses Tab 4 Settings
############################################################################
require_once("Settings.php");
require_once(
"common.php");
############################################################################
$TITLE$SITE[&#39;organ&#39;] . " Live Lightning";
$showGizmo true;  // set to false to exclude the gizmo
include("top.php");
############################################################################
?>

<link rel="stylesheet" type="text/css" href="./NSstyle.css" media="screen" title="screen" />
<script type="text/javascript" src="./NSajax.js"></script>
<style type="text/css">
#page {width: 1070px }
</style>
</head>
<body>
<?php
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
?>


<div id="main-copy">

  <?php
    $path_to_NSfiles 
"./";                                                // path to where all of the NSdisplay files are located.
    
include($path_to_NSfiles "NSdisplay.php");
?>


<div id="faq-copy">

  <div id="info" class="faqBox">
<h1>Map Legend</h1>

<p>Nexstorm can identify both approximate range and type of lightning. Cloud to Ground is obviously much more dangerous than intracloud. Both show how much energy is in a storm cell.</p>

<div align="center">
+<acronym title="CG = Cloud to Ground">CG</acronym> Positive cloud to ground strike |
-<acronym title="CG = Cloud to Ground">CG</acronym> Negative cloud to ground strike<br/>
+<acronym title="IG = IntraCloud">IG</acronym> Positive intracloud strike |
-<acronym title="IG = IntraCloud">IG</acronym> Negative intracloud strike<br/> <br/>

<table border="0">
<tr>
<td valign="middle" align="center">
<img src="stormtrac.gif" width="142" height="111" alt="TRAC key"></img>
</td>
<td width="10">&nbsp;</td>
<td valign="middle" align="left">
<div align="center"><b>Storm ID Key:</b></div>

<div id="key" class="keyBox">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr style="text-decoration: underline; background-color: rgb(230,223,207);"><td>Dashed Circle</td><td>Strike Rate/Min</td><td>Classification</td></tr>
<tr style="background-color: rgb(230,223,207);"><td><span style="color: green;">Green</span></td><td>1-10</td><td>Weak</td></tr>
<tr style="background-color: rgb(230,223,207);"><td><span style="color: yellow;">Yellow</span></td><td>11-49</td><td>Moderate</td></tr>

<tr style="background-color: rgb(230,223,207);"><td><span style="color: red;">Red</span></td><td>>50</td><td>Severe</td></tr>
</table>
</div>
J-3226 is a computer assigned identifier.
<br/><span style="color: blue;">-</span> or <span style="color: red;">+</span> indicates dominating strike polarity.
<br/>10 indicates last recorded strike rate.
<br/>^ - v indicates if storm is increasing, steady, or decreasing.<br/><br/>

</td>
</tr>
</table>
</div>

</div><!-- end main-copy -->

<?php
############################################################################
include("footer.php");
############################################################################
# End of Page
############################################################################
?>



Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9405
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Php 8.1
« Reply #20 on: April 16, 2023, 09:25:42 AM »
Please post the NSdisplay.php script.  That is likely the failing part.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #21 on: April 16, 2023, 10:01:51 AM »
I did try to post that, but it said it was over the 2000 character limit. Is there any other way to get it to you?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9405
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Php 8.1
« Reply #22 on: April 16, 2023, 11:12:36 AM »
Sure, copy to a .txt file and attach it to a post.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #23 on: April 16, 2023, 01:41:34 PM »
Ahh good idea, I will do it as soon as I get home from work.

Offline JupiterJoe

  • Senior Contributor
  • ****
  • Posts: 195
  • JupiterWX.com
    • Live Jupiter, FL Weather
Re: Php 8.1
« Reply #24 on: April 17, 2023, 10:28:55 AM »
Here it is, thank you again for your help.