PHP 500 error with PHP 8, no error with PHP 7

great :slight_smile: works again :slight_smile: but. when the upgrade to php version 8 or higher.

All current PWS_Dashboard scripts are PHP 8 compliant and are tested with different PHP 8.1 and 8.2 versions

@ ALL
The demo sites run different versions of PHP 8.x.y and I change those every few weeks.
I am not aware of any problems with PHP 8

Run the PWS_updates.php script
If there are any update advised:
β†’ download, unzip and install the newer scripts.

Then you can set your webhost PHP version to the latest version available.

Wim

Website is up 2 date but still getting error 500, switching back 2 php 7*, site is up again

That is not good, but I need to see the current warnings/errors in your website to check what the problem could be. PHP 7 warnings sometime are errors or fatal in PHP 8.

Running https://www.weerstationmedemblik.nl/_test.php shows at least one warning which should be removed first. It could be a fatal error for PHP 8.

Warning : mktime() expects parameter 1 to be int, string given in /var/www/vhosts/weerstationmedemblik.nl/httpdocs/PWS_extra_data.php on line 117

That is caused by the missing date-time for lightning:

|lightning|light|0|!
|lightningtime|wdtd||!
|lightningenergy|light|--|!
|lightningkm|light|0|!   // leave as last of the lightning values

The date-format (wdtd) expects a WeatherDisplay date-time format.

You could test by removing / commenting all lightning lines
Better remove/comment all lines you do not need.

I will come back to you tomorrow if I can find more problems.

Wim

Hi Soulmaster,

Another problem in your current setup:
You have set an alternative for the Darksky forecast by using OpenWeather.
Sadly the API key seems invalid as only empty data is returned.
This results in numerous errors, but none fatal for PHP 7 but PHP 8 will fail.

For instance: The 1 hour forecast in the SkyBlock is invalid.
Solution: In PWS_easyweathersetup.php
β†’ Tab API&Keys Question Darksky and alternatives after March 31, 2023
β†’ Select which alternative DS data provider you are using β†’ set to Not used
β†’ API Key for forecast and current conditions. β†’ clear that item

Succes,
Wim

OW discarded the β€œold” 2.5 version of getting data which we used when testing openweather.

You now need an β€œpaid for” 3.0 version’ Which, for normal websites, is also free as it has a large free allowance .

Check your openweather dashboard and select the proper 3.0 setup.


You then have to change line 38 in WS_Dark_Openweather.php|01|2023-09-09| from

$owm_version    = '2.5';

to

$owm_version    = '3.0';

Wim