Php timezone error?

Support intro

When I try to run occ command or any php related script in terminal, it report endless warning:

PHP Warning:  DateTime::createFromFormat(): Invalid date.timezone value 'Asia/China', we selected the timezone 'UTC' for now. in /var/www/html/nextcloud/lib/private/Log/LogDetails.php on line 48

Then I edit the timezone configure in

/etc/php/7.4/php.ini
/etc/php/7.4/apache2/php.ini
/etc/php/7.4/cli/php.ini

as Asia/Hong_Kong
Then PHP related command doesn’t return warning, but end with Segmentation fault

Nextcloud version : 21.0
Operating system and version : Ubuntu 20.04
Apache or nginx version : Apache 2.4.25
PHP version: 7.4

Anyone can help me to resolve this problem?(Seems the problem produced after I upgrade to NC21)

Hello @zydisney ,

welcome to the community of Nextcloud.

Your issue is not directly related with Nextcloud.
Please search the web regarding php + apache + and given message.

https://duckduckgo.com/?q=PHP+Warning%3A+DateTime%3A%3AcreateFromFormat()%3A+Invalid+date.timezone+apache&t=ffab&ia=web

btw. have you restarted your webserver after doing changes?

Asia/Hong_Kong is a valid value. The segfault you get may be a different issue.