MINOR: ZM PHP date.timezone Error [SOLVED]

Forum for questions and support relating to the 1.25.x releases only.
Post Reply
Posts: 12
Joined: Mon Sep 12, 2011 6:19 am

MINOR: ZM PHP date.timezone Error [SOLVED]

Post by bkamen » Mon Sep 12, 2011 6:31 am

This one isn't a deal breaker, but Apache's logs scream and complain about this:

Code: Select all

PHP Warning:  strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /var/www/html/zm/includes/functions.php on line 1427, (and then a referred URL that this forum complains about - so i removed most of but points to localhost/zm/index.php)
Might be nice to fix that one up (unless it's something with RHEL6)..


Last edited by bkamen on Wed Sep 14, 2011 8:40 pm, edited 1 time in total.

Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: MINOR: ZM PHP Error (on CentOS6)

Post by mastertheknife » Tue Sep 13, 2011 6:17 pm

There is no way to fix this. Recent PHP versions don't trust the system's timezone and want the administrator to edit php.ini and set the correct timezone there.

Kfir Itzhak.

Posts: 12
Joined: Mon Sep 12, 2011 6:19 am

Re: MINOR: ZM PHP date.timezone Error [SOLVED]

Post by bkamen » Wed Sep 14, 2011 8:40 pm


Got it -- thanks.


Posts: 98
Joined: Fri Feb 25, 2005 3:41 am
Location: England

Re: MINOR: ZM PHP date.timezone Error [SOLVED]

Post by caseystone » Sun Feb 12, 2012 4:35 pm

The fix specifically is to find your php config file (php.ini in /etc or somewhere), find the part about date.timezone and change it to something like this:

; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/London

A funny thing that happened to me when doing this is I realized I did not actually have a php.ini file at all, and when I used the example 'production' one and made the timezone change, I could no longer load ZM's index.php -- it showed a blank page. Something in the default php.ini killed it (it wasn't set to safe mode). The fix for me (weak though it is) at that point was to create a php.ini file with ONLY the date section in there. Seems to work so far.

BTW, this is me making an attempt to get Zoneminder working on FreeBSD.
SB G620 on Asus P8H67-M LX, 4GB, WD10EURS 'DVR' drive. Ubuntu 10.04.3 server. System load <=1.

8-port 240fps BTTV capture card, 6 cams. Modect 1 zone blobs of mx area 3, mx blobs 1. Some on alarmed pixels mn5/mx80. Mons not linked.

Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Re: MINOR: ZM PHP date.timezone Error [SOLVED]

Post by bb99 » Sun Feb 12, 2012 6:53 pm

When the index page comes up blank change short_open_tag from 'off' to 'on' in php.ini. There's at least two entries so be sure to check and/or change them all.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests