Hi,
I saw that this problem has already been mentioned twice, both with php7 and php8.
In both cases it was considered resolved by editing the php.ini.
I tried this too and it didn't work.
When executing the phpinfo() function, the timezone corresponds to the one defined in the php.ini (date.timezone = Europe/Berlin).
But when executing the date() function, the Segmentation fault error occurs.
I wrote a program to test in which situations the error occurs:
<?php
// Only for debugging TZ error
f_time("CET");
f_time("UTC");
f_time("EST");
f_time("Asia/Singapore");
f_time("Europe/Berlin");
echo(PHP_EOL.PHP_EOL.date("d/m/Y-H:i:s").PHP_EOL);
function f_time($zone) {
echo("Time now in ".(date_default_timezone_set($zone) ? (date_default_timezone_get().": ".date("d/m/Y-H:i:s")) : 'TZ error: '.$zone." is invalid").PHP_EOL);
}
?>
The result of the execution with php-cli is:
Time now in CET: 21/02/2023-13:45:53
Time now in UTC: 21/02/2023-12:45:53
Time now in EST: 21/02/2023-07:45:53
Fatal error: Uncaught Error: Timezone database is corrupt. Please file a bug report as this should never happen in /overlay/reactphp/Foxbit6/timezoneError.php:11
Stack trace:
#0 /overlay/reactphp/Foxbit6/timezoneError.php(11): date_default_timezone_get()
#1 /overlay/reactphp/Foxbit6/timezoneError.php(6): f_time('Asia/Singapore')
#2 {main}
thrown in /overlay/reactphp/Foxbit6/timezoneError.php on line 11
Comment: When commenting line with "Asia/Singapore", the same error occurs on line with "Europe/Berlin".
Another thing that caught my attention was that the result of the timezone_abbreviations_list() function does not contain many cities. But it contains for example "Asia/Singapore" which also gives the error. So this table returned by the timezone_abbreviations_list() function doesn't seem to be used.
I have installed zoneinfo-southamerica and upgraded all packages of OpenWrt 22.03.3 r20028-43d71ad93e, without solution.
All php 8.1.18-1 are installed and upgraded.
Looking at the downloadable zoneinfo OpenWrt package sizes, the northamerica is large, while southamerica is really small, almost empty. I wonder if our local Makefile is outdated and does not take into account the structural changes in the last decade, when IANA timezones have been simplified to some extent.
Edit:
Yeah, the zoneinfo Makefile is structurally 9 years old, and apparently does not take into account the upstream structural changes since then.