CodeIgniter Forums
PHP 5.3 and the Log Library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: PHP 5.3 and the Log Library (/showthread.php?tid=40300)



PHP 5.3 and the Log Library - El Forum - 04-05-2011

[eluser]emorling[/eluser]
The latest CodeIgniter has run fine on 5.2, but I upgraded to 5.3 today.

Now I get tons of errors with the Log class. Any ideas?

Code:
A PHP Error was encountered

Severity: Warning

Message: 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 'Europe/Berlin' for 'CEST/2.0/DST' instead

Filename: libraries/Log.php

Line Number: 86

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 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/tildinne/public_html/server/system/libraries/Log.php on line 86

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 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/tildinne/public_html/server/system/libraries/Log.php on line 86

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 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/tildinne/public_html/server/system/libraries/Log.php on line 99

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 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/tildinne/public_html/server/system/libraries/Log.php on line 99
A PHP Error was encountered

Severity: Warning

Message: 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 'Europe/Berlin' for 'CEST/2.0/DST' instead

Filename: libraries/Log.php

Line Number: 99



PHP 5.3 and the Log Library - El Forum - 04-05-2011

[eluser]InsiteFX[/eluser]
Add this in you index.php after the error_reporting
Note: Not need in CI 2.0
Code:
// PHP 5.3 needs this.
if(ini_get('date.timezone') == '')
{
    date_default_timezone_set('GMT');
}

To just set the date and time zone
Code:
date_default_timezone_set('America/New_York');

InsiteFX


PHP 5.3 and the Log Library - El Forum - 04-05-2011

[eluser]emorling[/eluser]
Thanks that did the trick!


PHP 5.3 and the Log Library - El Forum - 02-16-2012

[eluser]henesnarfel[/eluser]
I still had to do this in 2.1.0. I'm hosting with godaddy and they give you a very slimmed down php.ini. If you go in and set this
Code:
date.timezone = "America/New_York"
in your php.ini you shouldn't have to do the above in your index. Kind of a problem for me with multiple applications and building more. Didn't want to have to keep doing that.


PHP 5.3 and the Log Library - El Forum - 02-16-2012

[eluser]InsiteFX[/eluser]
Not all hosting providers allow you access to php.ini



PHP 5.3 and the Log Library - El Forum - 02-16-2012

[eluser]henesnarfel[/eluser]
Didn't say they did but the php.ini edit is a better approach if you are able to do it.