MINOR: ZM PHP date.timezone Error [SOLVED]

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

MINOR: ZM PHP date.timezone Error [SOLVED]

Post by bkamen »

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)..

Cheers,

-ben
Last edited by bkamen on Wed Sep 14, 2011 8:40 pm, edited 1 time in total.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: MINOR: ZM PHP Error (on CentOS6)

Post by mastertheknife »

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.

mastertheknife
Kfir Itzhak.
bkamen
Posts: 12
Joined: Mon Sep 12, 2011 6:19 am

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

Post by bkamen »

Derp.

Got it -- thanks.

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

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

Post by caseystone »

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:

[Date]
; 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.
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

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

Post by bb99 »

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.
Locked