Author Topic: River Page & PHP 8.1  (Read 374 times)

0 Members and 1 Guest are viewing this topic.

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 368
River Page & PHP 8.1
« on: April 27, 2022, 03:28:34 PM »
I am having issues with my river page. I have to disable warnings in my php.ini file or the page will not load due to so many errors or it takes a long time to load. It is East Masonville Weather script. I have sent him a email and have not gotten a response.

Quote
[24-Apr-2022 13:32:11 America/Los_Angeles] PHP Warning:  simplexml_load_file(): ./river-LNDW1.txt:1: parser error : Document is empty in /home/goblesweather/www/www/River/river-fetch.php on line 110 
Here is the link to this file   https://www.goblesweather.com/River/river-LNDW1.txt    It is not empty.
[24-Apr-2022 13:32:11 America/Los_Angeles] PHP Warning:  simplexml_load_file():  in /home/goblesweather/www/www/River/river-fetch.php on line 110
[24-Apr-2022 13:32:11 America/Los_Angeles] PHP Warning:  simplexml_load_file(): ^ in /home/goblesweather/www/www/River/river-fetch.php on line 110
Here is the line 110
Code: [Select]
$xmlData["$riverid"] = simplexml_load_file($xmlFileData);
I have attached a copy of my river-fetch script.

When I click on any of the links to any river the page is blank.

Chuck

« Last Edit: April 27, 2022, 03:33:54 PM by andro700 »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8621
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: River Page & PHP 8.1
« Reply #1 on: April 27, 2022, 03:47:18 PM »
You should try the attached update.. it works on PHP 8.1
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

Offline drrehak

  • Senior Member
  • **
  • Posts: 51
Re: River Page & PHP 8.1
« Reply #2 on: April 28, 2022, 12:15:23 PM »
Are there other files somewhere for a new install?
Looking for river-config.php
Can't tell if river-status.php is needed or created.
Assuming /River/ has to be set for write access.
Anything else needed to setup?

Thanks.
Dan Rehak | Pittsburgh PA
Davis Vantage Pro 2 Plus | Meteobridge Pro
Local Site | Raspberry Pi 4B

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8621
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: River Page & PHP 8.1
« Reply #3 on: April 28, 2022, 12:27:56 PM »
Yes, the file I attached just contains the changed files from the last distribution.

Attached is the last full distribution I have .. just overwrite it with the update above and you'll have a complete set.
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

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2516
    • SouthEast Lincoln, NE Weather
Re: River Page & PHP 8.1
« Reply #4 on: April 28, 2022, 01:24:55 PM »
Thanks, Ken! [tup] =D> \:D/ =D>

This page hasn't worked for me for quite some time now.  But happily thanks to you it's fixed!

I even remembered to reactivate my 'river-fetch.php' CRONS. :-)
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8621
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: River Page & PHP 8.1
« Reply #5 on: April 28, 2022, 04:13:19 PM »
You're welcome :)

The last version of the script from eastmasonvilleweather.com was 3.13F in 2015.

I did some fixes in June, 2020 for a 3.13G version, and I've merged in the PHP 8+ fixes for a 3.13H version attached.
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

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 368
Re: River Page & PHP 8.1
« Reply #6 on: June 10, 2022, 10:03:35 AM »
I am getting the following errors when I try and run a cron job for the river-fetch.php file. I have the latest H river script. Any clues.

Code: [Select]
/home/goblesweather/www/www/River/river-fetch.php: line 1: ?php
: No such file or directory
/home/goblesweather/www/www/River/river-fetch.php: line 14: syntax error near unexpected token `"river-config.php"'
/home/goblesweather/www/www/River/river-fetch.php: line 14: `include("river-config.php");
'

Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8621
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: River Page & PHP 8.1
« Reply #7 on: June 10, 2022, 01:47:56 PM »
I'm not sure what cron command you are using, but you need to run the PHP interpreter and pass it the river-fetch.php file.
It looks like (based on the error message, you're just trying to run the river-fetch.php file directly.

Your cron command should look like:

Code: [Select]
/usr/local/php81/bin/php -q /home/goblesweather/www/www/River/river-fetch.php
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

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 368
Re: River Page & PHP 8.1
« Reply #8 on: June 10, 2022, 05:41:53 PM »
I will check it out. I am running the cron job via my web host.

Chuck

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 368
Re: River Page & PHP 8.1
« Reply #9 on: June 12, 2022, 02:55:15 PM »
I got it working using Curl and System Scheduler. Don't know why I didn't think of this way sooner. Much less headache than trying to figure cron jobs on my web host site.

Chuck