FuelPHP: Uncaught exception ‘Fuel\Core\PhpErrorException’…

FuelPHP is the new kid on the block for doing PHP development. As an HMVC framework, FuelPHP is a very well documented and features packed framework capable of delivering rapid app development. When generating a new controller with the oil command, if you guys happen to hit a wall with the following exception:

Fatal error: Uncaught exception ‘Fuel\Core\PhpErrorException’ with message ‘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/New_York’ for ‘EST/-5.0/no DST’ instead’ in …

It means that PHP can’t rely on the system’s host date to execute. The solution is quite simple. Open app/config/config.php and add the following PHP line :

[php]
return array(
‘default_timezone’ => ‘America/New_York’
);
[/php]

It will fix your problem!

One comment

  1. Awesome! This was driving me nuts.

    Commentaire by Psobko on 3 décembre 2012 at 22 h 44 min