Closed iyerusad closed 4 years ago
Baseimage handles that for php-fpm during fresh start: https://github.com/linuxserver/docker-baseimage-alpine-nginx/blob/master/root/etc/cont-init.d/20-config#L20
Baseimage handles that for php-fpm during fresh start: https://github.com/linuxserver/docker-baseimage-alpine-nginx/blob/master/root/etc/cont-init.d/20-config#L20
Wouldn't that make it not an environment variable then (rather, a first boot parameter)?
It's an environment variable for the container OS.
For php, it's a first boot parameter because it is set in a user configurable file and we don't modify those after creation to ensure we don't overwrite user settings
Sounds like there should be one of the following outcomes:
A) Remove TZ
variable from this package (since it is unable to effectively define the timezone in the core runtime of this container, namely php).
B) Adopt upstream fix: Inject helper snippet to Docker file:
find /etc/php*/ -name php.ini -exec sed -r -i "\#^;?date.timezone#s#^.*#date.timezone = $TZ#" {} \;
C) Update TZ
variable documentation to reflect its only used once (aka a build variable) and future updates are done via editing the php.ini file. Least desirable since whole point is to have environment variable be effective (in the context of the application that the container is hosting).
Everything here is working as intended. If you want to change any php settings for any reason, edit the php-local.ini and/or www2.conf in the config for and restart the container
If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.
Expected Behavior
Setting
TZ
environment variable sets timezoneCurrent Behavior
PHP within container is not aware of
TZ
environment variable setting.Apparently, PHP is not using the system parameters since PHP 5.4 http://php.net/manual/function.date-default-timezone-get.php
This is fixed upstream in https://github.com/FreshRSS/FreshRSS/pull/2218. Discussed in https://github.com/FreshRSS/FreshRSS/issues/2153.
Steps to Reproduce
php -r 'echo date_default_timezone_get(), "\n", date("c"), "\n";'
or
sudo docker run -it -e TZ=Europe/Paris --rm linuxserver/freshrss:latest php -r 'echo date_default_timezone_get(), "\n", date("c"), "\n";'
Environment
OS: Synology
CPU architecture: x86_64
How docker service was installed: Synology package
Command used to create docker container (run/create/compose/screenshot)
sudo docker run -it -e TZ=Europe/Paris --rm linuxserver/freshrss:latest php -r 'echo date_default_timezone_get(), "\n", date("c"), "\n";'
Docker logs
php -r 'echo date_default_timezone_get(), "\n", date("c"), "\n";'