3
votes

I get the following error in CakePHP:

Warning (2): strtotime() [http://php.net/function.strtotime]: 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 [ROOT/cakephp/cake/libs/cache.php, line 570]

Also I am getting the notice:

Trying to get property of non-object in /htdocs/cakephp/cake/libs/cache/file.php on line 248 Fatal error: Call to a member function cd() on a non-object in /htdocs/cakephp/cake/libs/cache/file.php on line 248

I have added the line date_default_timezone_set("America/Anchorage"); to the top of [cake base directory]/libs/cache.php trying to solve the problem. But the error persists.

Any hints?

2

2 Answers

14
votes

You have to uncomment the line with date_default_timezone_set in app/config/core.php and the warnings should disappear.

3
votes

/app/config/core.php:

/**
 * If you are on PHP 5.3 uncomment this line and correct your server timezone
 * to fix the date & time related errors.
 */
    //date_default_timezone_set('UTC');