Not safe to rely on the system's timezone settings : Apache Error- Solved

Apache Error: not safe to rely on the system's timezone settings 

(php | wordpress | joomla | phpmyadmin | phpinfo | zabbix | drupal)

After Upgrading the PHP, following error message was coming in the httpd error_log log

PHP Error :

#tail -f /var/log/httpd/error_log

[Fri Jul 23 17:15:31 2010] [error] [client ] PHP Warning:  date() [function.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 'Asia/Calcutta' for 'IST/5.0/no DST' instead in /IlohaMail/include/ryosimap.inc on line 117, referer:

Solution:

1. Locate the php.ini file - the default location is etc/php.ini

#vim /etc/php.ini
2. Search for 'timezone' in php.ini file
3. change
;date.timezone =
to
date.timezone = "America/New_York"
or whatever specific timezone you are in.



FOLLOW US :-    
   





1 comments :

  1. I have following timezone settings in /etc/php.ini
    date.timezone='Asia/Karachi'

    causing the above posted warnings. I then changed to following:

    date.timezone="Asia/Karachi"

    then issues got resolved.

    The reason was the single quotes which was changed to double quotes in /etc/php.ini under date section.

    Thanks for the advise & contributor.

    ReplyDelete