Hi
I have been using PWS dashboard for ages now and have now decided to update to php 8. When I update the server with my Provider (IONOS) to PHP 8 the website wont load, but on php 7.4 it works fine.
I uploaded a test site using PHP8 and that loaded fine, so is there a tool, command that I can use/lookat to see which blocks if any are causing the problem.
Thanks
The current 2012_lts release is tested with PHP 8.1.13
check 2.1 : Your current PHP version is : 8.1.13
If you are using a higher version please use . . . your website . . /startHere.php and note down the version.
IONOS.eu uses 8.0, 8.1 for which PWDS_Dashboard is fully tested.
But it serves 8.2 also.
=> That version is not extensively tested as I have limited access to a 8.2 test server.
=> PHP 8.2 was introduced on Dec 8, not yet available for my own test-servers.
==> Important: always re-run . ./pwsWD/startHere.php just to make sure that all php modules are included (f.i. xml and GD support)
==> Important: check Saratoga scripts such as NWS-alerts, see next post from Ken True (saratogaWX)
All PHP errors / all versions:
As not all scripts are original PWS_Dashboard scripts I need to see the errors, please copy the errors and add them to a .txt file, zip them and post the zip.
You should see the errors / cause of the blank screen by adding ?test to the url
Or even better use . . your website . . /_test.php
Also you could pinpoint problems with . . your website . . /PWS_module_test.php
Be aware that most providers have a different folder structure when moving to PHP 8.
It is the same as when moving to another provider and the scripts will therefor loose contact with included file-load scripts.
You should always run
. ./pwsWD/startHere.php => check for errors
easyweather-setup when moving from PHP 7.x to PHP 8.x
PHP 8.2
Also there are not a lot of PHP 8.2 users in the coming months.
Most users will wait until at least 8.2.1 is available
Today (2022-12-28) the first PHP 8.2 is not widely available therefor not all dashboard scripts are tested with PHP 8.2
My resources are limited to 8.1.9 → 8.1.13 and only a few tests at a Raspberry with 8.2.0
Wim
Edit 2022-12-28 10:30 UTC → added warning to wait with 8.2 until version 8.2.1
Heads up - PHP 8.2 has a deprecation for variable definitions of ${varname}
I’ve just started testing the Saratoga templates and scripts and found that PHP 8.2 has a deprecation for a variable naming the is used in many of my (and others) scripts:
[b]"${var}" and "${expr}" style interpolation[/b]
The “${var}” and “${expr}” style of string interpolation is deprecated.
Use “$var”/“{$var}” and “{${expr}}”, respectively.
This means that all ${varname} have to be changed to {$varname} throughout the scripts. It’s as simple as doing a global find for “${” and replacing it with “{$” and it is backwards compatible to PHP 5.6 (in my testing).
I’ll be updating all my scripts with this shortly.
If you update your Saratoga site to PHP 8.2 before I finish the updates, be sure to turn off E_DEPRECATED in php error_reporting to not flood your error messages in your log (or displays on your website if display_errors is on).
I checked the Curly NWS scripts and there are also a few lines with “${”
PWS_dasboard users from the US are often using these scripts (Saratoga-Weather.org - Legacy Scripts) .
I found that the ‘[${1},${2}]’ has to be ‘[$1,$2]’ otherwise the { and } get included (which breaks the JavaScript.
Likewise ‘${2}/${3}/${1}’ can be replaced with ‘$2/$3/$1’
I don’t fully agree with their deprecation as the ${varname} notation has been with us from PHP 4+ and now is set for removal in PHP 9. Sigh.
In one of the classes used in get-USNO-sunmoon.php, I did encounter this deprecation.
I had to declare as ‘public’ each of the variables that were dynamically defined.
No… the distributed versions in Base-USA were correct. Only the legacy-scripts version hasn’t been updated (yet). The nws-alerts-details-inc.php was the only script that needed change such as above, and that was done in Base-USA.
No, not Base-World. The Curly NWS scripts (nws-alerts*) are only in the Base-USA since they are USA specific and my comment about the two nws-alert instances were only for those scripts. Base-World has get-meteoalarm-warning-inc.php for alerts from meteoalarm.eu feeds.
I use IONOS as my host and updated to PHP 8.1.13 yesterday.
Overnight I have had some errors producing a red exclamation tick. The error shown is
./_my_settings/history.txt _history Stalled 1 days 19 hrs 30 mins 55 seconds max = 10 mins
$history[“last_roll_over”] _history_rollover Stalled 2 days 7 hrs 15 mins 55 seconds max = 23 hrs
Hi,
This is a new error, please leave as is so i can investigate.
I checked your scripts, they are recent.
I can not replicate it at my test server so i have to dig deeoper.
What PHP 8.1 errors are you referring to?
The extra temp block will give identical errors with PHP 7.x
change line 74 in your version of the script to
$lines = 3;
as you left only three sensor descriptions in the script, not 6 as that line reads now.
The messages in the footer are the debug messages from PWS_load_files.php
The last line of those messages is the one I added. PWS_load_files.php (63) missing $statuses array with PHP version8.1.13
It seems that the array-contents which should be loaded or defined in line 44 or 45 is lost and replaced with a boolean value
Can be either
a specific PHP 8.1.13 error
or
some new error in the PWS_load_files.php
I have no access to a web-server running PHP 8.1.13
I can therefor not test if this is a PHP problem or anything else.
Continue to use the test-version of PWS_load_files.php and, if possible, check your webserver settings if another PHP 8.1 version can be selected.