Author Topic: php errors  (Read 574 times)

0 Members and 1 Guest are viewing this topic.

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
php errors
« on: June 28, 2020, 09:21:11 PM »
Hi folks

I have changed servers and i am now on php 7.2.31 and now i see 1 or 2 errors

the wxsim graph on the Leuven template at the bottom is giving out this, as see here (bottom of page) and below

Code: [Select]
Notice: Undefined offset: 0 in /home/breckland/public_html/wsWxsim/wsWxsimGenerateHtml.php on line 47

Warning: Division by zero in /home/breckland/public_html/wsWxsim/wsWxsimGenerateHtml.php on line 242

and the 3 in 1 wxsim script is having a chicken fit as seen here and below

Code: [Select]
Warning: Use of undefined constant moon - assumed 'moon' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 933

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 934

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant sun_1 - assumed 'sun_1' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 923

Warning: Use of undefined constant sun_2 - assumed 'sun_2' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 924

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 924

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 941

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant sun_1 - assumed 'sun_1' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 923

Warning: Use of undefined constant sun_2 - assumed 'sun_2' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 924

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 924

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 957

Warning: Use of undefined constant waterdrop - assumed 'waterdrop' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 958

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant sun_1 - assumed 'sun_1' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 961

Warning: Use of undefined constant sun_2 - assumed 'sun_2' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 962

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 962

Warning: Use of undefined constant waterdrop - assumed 'waterdrop' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 963

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant moon - assumed 'moon' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 977

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 978

Warning: Use of undefined constant waterdrop - assumed 'waterdrop' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 978

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant sun_1 - assumed 'sun_1' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 961

Warning: Use of undefined constant sun_2 - assumed 'sun_2' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 962

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 962

Warning: Use of undefined constant waterdrop - assumed 'waterdrop' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 963

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant moon - assumed 'moon' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 1085

Warning: Use of undefined constant fog - assumed 'fog' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 1085

Warning: Use of undefined constant fog - assumed 'fog' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 1086

Warning: Use of undefined constant fog - assumed 'fog' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 1086

Warning: Use of undefined constant fog - assumed 'fog' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 1086

Warning: Use of undefined constant fog - assumed 'fog' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 1087

Warning: Use of undefined constant fog - assumed 'fog' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 1087

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant sun_1 - assumed 'sun_1' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 919

Warning: Use of undefined constant sun_2 - assumed 'sun_2' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 920

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 920

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant moon - assumed 'moon' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 933

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 934

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 953

Warning: Use of undefined constant waterdrop - assumed 'waterdrop' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 954

Warning: Use of undefined constant waterdrop - assumed 'waterdrop' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 954

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 957

Warning: Use of undefined constant waterdrop - assumed 'waterdrop' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 958

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant sun_1 - assumed 'sun_1' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 966

Warning: Use of undefined constant sun_2 - assumed 'sun_2' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 967

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 967

Warning: Use of undefined constant waterdrop - assumed 'waterdrop' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 968

Warning: Use of undefined constant waterdrop - assumed 'waterdrop' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 968

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant moon - assumed 'moon' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 977

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 978

Warning: Use of undefined constant waterdrop - assumed 'waterdrop' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 978

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant sun_1 - assumed 'sun_1' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 915

Warning: Use of undefined constant sun_2 - assumed 'sun_2' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 915

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 916

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant moon - assumed 'moon' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 930

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 930

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481

Warning: Use of undefined constant sun_1 - assumed 'sun_1' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 915

Warning: Use of undefined constant sun_2 - assumed 'sun_2' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 915

Warning: Use of undefined constant cloud - assumed 'cloud' (this will throw an Error in a future version of PHP) in /home/breckland/public_html/wxall.plaintext.php on line 916

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/breckland/public_html/wxall.plaintext.php on line 481


Kind regards
Bashy

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: php errors
« Reply #1 on: June 29, 2020, 03:36:59 AM »
Hi folks

I have changed servers and i am now on php 7.2.31 and now i see 1 or 2 errors
the wxsim graph on the Leuven template at the bottom is giving out this, as see here (bottom of page) and below

Code: [Select]
Notice: Undefined offset: 0 in /home/breckland/public_html/wsWxsim/wsWxsimGenerateHtml.php on line 47
Warning: Division by zero in /home/breckland/public_html/wsWxsim/wsWxsimGenerateHtml.php on line 242
. . .
The http://www.brecklandweather.com/wsWxsim/  folder contains  files with a timestamp from 2015.
Checking the index.php html the wsWxsimGenerateHtml script is from
Code: [Select]
module wsWxsimGenerateHtml.php ==== version: 2.30 2013-09-30
It seems impossible to use sce=view with that old version as http://www.brecklandweather.com//wsWxsim/wsWxsimGenerateHtml.php?sce=view  switches back to the index.php page.

In my oldest version (3.1 from March 2015) those errors can not occur at lines 47 or 242 as there are no PHP statements on those lines.

Could you please zip that script wsWxsimGenerateHtml.php and post it here so i can check that script?

===

Also, could you please set line 6 of index.php to comment by adding a # on the first position of that line.  Change it from
Code: [Select]
$wsDebug = true; // ##### make comment after testing
to
Code: [Select]
#$wsDebug = true; // ##### make comment after testingThis will remove all unnecessary warnings and notices. You can always check errors by adding &debug to the liner in the browser.

Wim

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: php errors
« Reply #2 on: June 29, 2020, 06:41:08 AM »
HI Wim, thanks for the reply, i see what you mean about it switching back, weird....
Not sure why its doing that, but then i dont have a clue about much as im sure it shows  :oops:

I have commented out that line now with a # as asked.

I have enclosed that file, i have had to use the zip feature in winrar so i hope it works, i do have winzip but the options not there in the context menu to zip, let me know if it opens ok, failing that i will do it manually....

PS, yes, it lot of it is old scripts due to me modifying things and not remembering where i did so, for example, those links top right of the banner, been searching for that one for a couple of years on and off now lol still linking to my old site  :oops:  #-o
I really need to get my head down and tidy it up., its even harder when i dont remove old scripts, i dare not in case ive linked to it in one way or another, i have a really bad memory..}
For example, my site has, 2473 files in 169 folders (26.75gb) ok, so a lot of that is graphs and video but i still have my old, my 1st ever home made site
http://www.brecklandweather.com/wx2.html
And this one still on there
http://www.brecklandweather.com/indexOLD.php
I hate to throw things out just in case lol
« Last Edit: June 29, 2020, 06:49:44 AM by Bashy »
Kind regards
Bashy

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: php errors
« Reply #3 on: July 08, 2020, 05:33:01 AM »
These 2013 scripts fail on so many places that you should not use those. A lot of changes since PHP 5.2

The two error lines from your first post occur only as there is no plaintext.txt processed.
You can check that the "Overview" tab is completely empty.

I attach the wsWxsimGenerateHtml.php script which suppress the errors but the plaintext parser generates dozens of errors also.
Sorry that i can not help you further.

Wim

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: php errors
« Reply #4 on: July 15, 2020, 02:44:49 AM »
Thanks Wim, i had a feeling that might be the case, probably going to have to bite the bullet and update and lose all the mods done :(
Kind regards
Bashy