Closed (won't fix)
Project:
Cite
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
27 Oct 2009 at 00:34 UTC
Updated:
15 May 2013 at 10:15 UTC
I'm running PHP 5.3.0 (installed as part of OS X upgrade to Snow Leopard) and am getting the following warnings when I view /q=cite/[nid]:
# warning: date(): 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/Los_Angeles' for 'PDT/-7.0/DST' instead in /Library/WebServer/Documents/drupal6/sites/default/modules/cite/cite.module on line 186.
# warning: date(): 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/Los_Angeles' for 'PDT/-7.0/DST' instead in /Library/WebServer/Documents/drupal6/sites/default/modules/cite/cite.module on line 192.
Comments
Comment #1
ki commentedIt seems to be a warning introduced by PHP 5.3 (http://drupal.org/node/598636).
The quick fix on user side would be to set the timezone in php.ini.
Can you insert the following lines at line 13 (cite.module) inside cite_init() and see if it works for you?
I hope core addresses this issue site wide though.
Comment #2
ki commentedAccording to PHP manual (http://www.php.net/manual/en/function.date-default-timezone-get.php), date_default_timezone_get() will still throw the warning without timezone set.
Any suggestions are welcome.
Comment #3
twoblackeyes commentedIs there any way to patch this? I'm developing on my OS X 10.6 machine as well and this error is all over the place.
UPDATE Here's helpful instructions for hard-coding your timezone with php.ini on OS X 10.6
http://supercali.inforest.com/forum/viewtopic.php?id=817
Note: Activating the entire contents of php.ini.default nuked something and my site wouldn't load. But if you save a new php.ini file with only the date settings:
...everythign appears to be working, and the timezone error is gone on my development machine. Obviously update the string for your own timezone. You can verify that it's working under the 'date' section of phpinfo().
Comment #4
markj commentedSince this seems to be an issue with PHP 5.3.0, why not add this to cite_init() and mark it as a known issue with that version until core does fix it:
If people need to manually add their own timezone instead of 'UTC' they can.
Comment #5
ki commentedSince it would need to set timezone only if timezone is not already set, we'd need a conditional.
Something like,
Would @ suppress the warning here?
Comment #6
markj commentedI'll check @ tonight, as the problematic environment is on my laptop, which is at home.
Comment #7
markj commentedNope, @ doesn't do it.
Comment #8
ki commentedThat's a tricky little devil, isn't it?
I will wait and see if there is a way to gracefully handle it.
If I don't, I'd have to close the issue as "won't fix".
Comment #9
npoleon06 commentedI am getting the same error after enabling the AGGREGATOR module and running CRON.
Comment #10
scripter2008 commentedI'm new to drupal and see this error in various places. Lately when I was looking at how to ban an IP I saw the error appear in troll.admin.inc at lines 617, 642, 647 and 652. I'm using drupal 6.14 with PHP 5.3.0 as well.
Comment #11
cannedbrain commentedTry to add this configuration to your 'settings.php' file (inside /sites/default folder or /sites/yoursite.com):
Change the timezone to yours accordingly. Seems good so far. I'm using drupal 6.16 on Mac OS X Snow Leopard, btw.
Comment #12
fradipa commentedCiao a tutti,
moving from php 5.2.x (apache/linux) to php 5.3 (apache/Mac Os 10.6.4),
I had the same problem...
The warning desappeared - as stated in #3 - adding:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Rome"
to php.ini
Bye
Comment #13
ki commentedIf you are using PHP 5.3, please follow instructions either in #11 or #12.
#11 affects only the site that contains the settings.php.
#12 affects all sites.
Comment #14
escapeit commentedTo find a valid timezone value:
http://php.net/manual/en/timezones.php
Comment #15
taggartj commentedI was getting the same issue in
modules/aggregator/aggregator.pages.inc on line 259
so i put
[Date]
; Defines the default timezone used by the date functions
date.timezone = "Australia/Melbourne"
in a file called php.ini on my site's root folder and it fixed it (i hope)
Comment #16
redaccion commented#3 This work for me... Tnks¡¡¡
Comment #17
astra commentedMy site under D5 got the same problem after upgrading to php5.3
Try to add this line to my settings.php
It seems to fix this problem for this site.