Author Topic: NWS (Atom) Alerts for Saratoga Templates PHP 7.1 problem  (Read 5126 times)

0 Members and 1 Guest are viewing this topic.

Offline n7xrd

  • Forecaster
  • *****
  • Posts: 366
    • Kamiah Weather
Re: NWS (Atom) Alerts for Saratoga Templates PHP 7.1 problem
« Reply #25 on: August 26, 2017, 10:27:57 AM »
php version 7.1 gives this error when there is a Warning appears to run when no warnings are present??  Have made the changes in this thread to no avail.
Warning: Illegal string offset 'WAZ021' in /home/sfiala/public_html/nws-alerts.php on line 308

Fatal error: Uncaught Error: Cannot use string offset as an array in /home/sfiala/public_html/nws-alerts.php:308 Stack trace: #0 /home/sfiala/public_html/header.php(41): include_once() #1 /home/sfiala/public_html/index.php(43): include('/home/sfiala/pu...') #2 {main} thrown in /home/sfiala/public_html/nws-alerts.php on line 308

Offline colonieweather

  • Contributor
  • ***
  • Posts: 143
    • Colonie Weather Online
Re: NWS (Atom) Alerts for Saratoga Templates PHP 7.1 problem
« Reply #26 on: September 05, 2017, 07:48:27 PM »
Hi,

I am getting that same error on same line now after going to php 7.1... "Fatal error: Uncaught Error: Cannot use string offset as an array"  and made Ken's recommended changes.  I saw that Curly updated script to fix, but link provided returns a 404.

-Chris
Davis Vantage Pro 2 Plus
WeatherLink v6.0.5
colonieweatheronline.com
Wx Underground - KNYCOLON3
APRS/CWOP - EW0288

Online CNYWeather

  • Forecaster
  • *****
  • Posts: 2295
    • CNYWeather
Re: NWS (Atom) Alerts for Saratoga Templates PHP 7.1 problem
« Reply #27 on: September 06, 2017, 06:28:11 PM »
I was able to get Version 2.01 off his downloads site
« Last Edit: September 06, 2017, 06:30:11 PM by CNYWeather »
Tony




Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: NWS (Atom) Alerts for Saratoga Templates PHP 7.1 problem
« Reply #28 on: September 06, 2017, 06:36:54 PM »

Offline colonieweather

  • Contributor
  • ***
  • Posts: 143
    • Colonie Weather Online
Re: NWS (Atom) Alerts for Saratoga Templates PHP 7.1 problem
« Reply #29 on: September 06, 2017, 08:58:32 PM »
Thanks Curly!

It seems to be bombing out on this line:
$logData[] = array($event,$cvk,$effective,$expires,$cis['icon'],$areaDesc,$abbrvDesc);

Got this error:  PHP Fatal error:  Uncaught Error: [] operator not supported for strings

Server is using v 7.1.4
Davis Vantage Pro 2 Plus
WeatherLink v6.0.5
colonieweatheronline.com
Wx Underground - KNYCOLON3
APRS/CWOP - EW0288

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: NWS (Atom) Alerts for Saratoga Templates PHP 7.1 problem
« Reply #30 on: September 06, 2017, 09:15:44 PM »
I recommend adding a couple of lines of PHP temporarily to see what other (if any) issues you may have.

Code: [Select]
<?php
error_reporting 
(E_ALL E_STRICT);
ini_set("display_errors"1);
?>


I was able to clean up all the PHP 7 issues this way.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: NWS (Atom) Alerts for Saratoga Templates PHP 7.1 problem
« Reply #31 on: September 24, 2017, 11:14:18 AM »
EDIT: nws-alerts-log.php  does not work with php 7.1 due to the same issue.

Was this question ever answered directly? "PHP Fatal error:  Uncaught Error: [] operator not supported for strings"

I have this error in conjunction with another script and I'm not clear on how to resolve it.  This is a new issue since migrating to PHP 7.1. 

« Last Edit: September 25, 2017, 10:16:59 PM by tmabell »