Page 1 of 1

PHP 8.x fatal error

Posted: Sun 16 Apr 2023 5:37 pm
by vpokroglo
Hello.

I have tried to change my webpage to php 8.x, but get the following fatal error:

[codeFatal error: Uncaught DivisionByZeroError: Division by zero in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php:372 Stack trace: #0 /home/okroglov/domains/okroglovreme.com/public_html/CUtags.php(747): include_once() #1 /home/okroglov/domains/okroglovreme.com/public_html/top.php(81): include_once('/home/okroglov/...') #2 /home/okroglov/domains/okroglovreme.com/public_html/index.php(35): include('/home/okroglov/...') #3 {main} thrown in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 372][/code]

any toughts?

Re: PHP 8.x fatal error

Posted: Sun 16 Apr 2023 6:36 pm
by saratogaWX
There's a problem with your CUtags.php -- it contains:

Code: Select all

System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
  at System.String.Substring (System.Int32 startIndex, System.Int32 length) [0x0001d] in <de882a77e7c14f8ba5d298093dde82b2>:0 
  at CumulusMX.TokenParser.Parse3 () [0x0007e] in <8be6f1044cfe411391a3124bdf024bf0>:0 
  at CumulusMX.TokenParser.ToString () [0x0002a] in <8be6f1044cfe411391a3124bdf024bf0>:0 
instead of the expected data. Have Cumulus regenerate the file from CUtags.txt and upload it.

Looking at check-fetch-times.php?show=wx shows the problem. Your ?show=versions does indicate you are at current releases for all the other scripts.

Re: PHP 8.x fatal error

Posted: Tue 18 Apr 2023 7:04 pm
by vpokroglo
I have all files from template updated, including CUtags.txt. When changing to PHP 8.x I got following error:

Code: Select all

Warning: A non-numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 82

Warning: A non-numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 82

Warning: A non-numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 83

Warning: A non-numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 83

Warning: A non-numeric value encountered in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 370

Fatal error: Uncaught DivisionByZeroError: Division by zero in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php:370 Stack trace: #0 /home/okroglov/domains/okroglovreme.com/public_html/CUtags.php(747): include_once() #1 /home/okroglov/domains/okroglovreme.com/public_html/top.php(81): include_once('/home/okroglov/...') #2 /home/okroglov/domains/okroglovreme.com/public_html/index.php(35): include('/home/okroglov/...') #3 {main} thrown in /home/okroglov/domains/okroglovreme.com/public_html/CU-defs.php on line 370

Re: PHP 8.x fatal error

Posted: Thu 20 Apr 2023 6:18 pm
by saratogaWX
The warning messages are due to your default format for numbers to use comma-format instead of the expected decimal/point-format for your CUtags.php.

Likewise, the UV value of '0,0' is causing the fatal error, which would not happen if the value was '0.0'

Re: PHP 8.x fatal error

Posted: Fri 21 Apr 2023 9:25 am
by mcrossley
Sounds like your template file for CU-defs.php needs to use the web tag option to use decimal "dot". For example...

<#temp> => 16,3
<#temp rc=y> => 16.3

Re: PHP 8.x fatal error

Posted: Fri 21 Apr 2023 6:38 pm
by saratogaWX
Is there a .ini setting that can force decimal dot for all processed web tags?

Re: PHP 8.x fatal error

Posted: Fri 21 Apr 2023 7:29 pm
by mcrossley
Nope :(