Page 1 of 1

MINOR: ZM PHP date.timezone Error [SOLVED]

Posted: Mon Sep 12, 2011 6:31 am
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

Re: MINOR: ZM PHP Error (on CentOS6)

Posted: Tue Sep 13, 2011 6:17 pm
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

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

Posted: Wed Sep 14, 2011 8:40 pm
by bkamen
Derp.

Got it -- thanks.

-Ben

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

Posted: Sun Feb 12, 2012 4:35 pm
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.

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

Posted: Sun Feb 12, 2012 6:53 pm
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.