Closed escservices closed 1 year ago
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
@escservices Might be worth confirming your exact container image version, and also ensuring you're on the latest image version. There have been some very recent changes to address this. More context in this thread and this PR of the base image.
Hi
Sorry about that; this is the exact build version -
Linuxserver.io version:- v23.05.2-ls85 Build-date:- 2023-06-12T18:23:03+00:00
Image - lscr.io/linuxserver/bookstack:v23.05.2-ls85
can you (inside the container) run cat /etc/php82/conf.d/30_timezone.ini
So, on two of my servers, it shows date.timezone = US/Eastern
and on the newest one it shows date.timezone = UTC
.
For some reason, the newest one, which is using the exact same image and is also running on RockyLinux, doesn't have the PHP warning, it's also the one showing UTC. It also doesn't have a TZ set in the docker compose.
I tried removing the TZ from other instances, and I tried setting the TZ to UTC, no luck in either case. The timezone id updating correctly though as I change it in the compose. The newest server that is working, I updated to US/Eastern and it works fine and reflects the change in that 30_timezone.ini file.
Could it be some kind of native Linux package that handles dates/times/timezones that's missing? One server was built in Azure, one is on-prem running in ESXI, and one is in Vultr, the one built on Vultr's Rocky image is the only server without the issue.
I had same problem, found that the php-local.ini file was missing the time zone name for the date.timezone = statement. This file was in the /config/php folder. Might be worth looking at...
We recently moved around the logic in our base image that is responsible for telling PHP what timezone you are using, and also added UTC as a fallback in the way we set the timezone so that PHP doesn't display the warning where it says it's falling back to UTC anyway.
We set the timezone inside the container in /etc/php82/conf.d/30_timezone.ini
and the logic for it is here https://github.com/linuxserver/docker-baseimage-alpine-nginx/blob/0ff477bdecba9064b07fd57e2cd354eb928202e1/root/etc/s6-overlay/s6-rc.d/init-php/run#L5
and we no longer set the timezone in /config/php/php-local.ini
because it's not needed in two files. If you manually set it in /config/php/php-local.ini
your setting should take priority.
In my case - somehow, I had this in the local file, I commented out the time zone statement in the php-local.ini file since it was covered in the /etc/php82/conf.d/30_timezone.ini file. All good no warning message now. Thanks for the explanation, very much appreciated!
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is locked due to inactivity
Is there an existing issue for this?
Current Behavior
When you run any php command, you'll see this error that the date.timezone value is blank. I don't think it breaks anything, it's just annoying. I have a timezone set in the .env file and TZ is set is in the docker compose for both the database and the app, which both seem to be working.
I found this bug while trying to run some bookstack command (which executed successfully) https://www.bookstackapp.com/docs/admin/commands/
I included one docker-compose below, but I also have another server I recently setup that has a docker compose with database and it has the same issue.
Expected Behavior
Running PHP commands don't throw PHP warning, timezone is passed through the docker compose to the PHP config.
Steps To Reproduce
Environment
CPU architecture
x86-64
Docker creation
Container logs