Welcome Guest, Not a member yet? Register   Sign In
PHP 5.3 and the Log Library
#1

[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
#2

[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
#3

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

[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.
#5

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

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




Theme © iAndrew 2016 - Forum software by © MyBB