Skip to content

[BUG] PHP Startup: Invalid date.timezone value '', using 'UTC' instead in Unknown on line 0 #178

Closed as not planned
@escservices

Description

@escservices

Is there an existing issue for this?

  • I have searched the existing issues

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.

image

Expected Behavior

Running PHP commands don't throw PHP warning, timezone is passed through the docker compose to the PHP config.

Steps To Reproduce

  1. Setup Bookstack
  2. Type PHP inside container.

Environment

- OS: RockyLinux 9.2
- How docker service was installed: repos on main docker website.

CPU architecture

x86-64

Docker creation

---
version: "2"
services:
  bookstack:
    image: lscr.io/linuxserver/bookstack:latest
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=https://asdfasdfasdfasdf
      - TZ=US/Eastern
    volumes:
      - /var/www/BookStack:/config
    ports:
      - 6875:80
    restart: unless-stopped

Container logs

[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

using keys found in /config/keys
App Key found - setting variable for seds
Waiting for DB to be available
PHP Warning:  PHP Startup: Invalid date.timezone value '', using 'UTC' instead in Unknown on line 0

   INFO  Nothing to migrate.  

**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│ 2022-08-16 │ 2023-04-13 │ /config/nginx/nginx.conf                                               │
│ 2022-10-04 │ 2023-04-13 │ /config/nginx/site-confs/default.conf                                  │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
[custom-init] No custom files found, skipping...
[ls.io-init] done.
[13-Jun-2023 14:40:25] NOTICE: PHP message: PHP Warning:  PHP Startup: Invalid date.timezone value '', using 'UTC' instead in Unknown on line 0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions