Symfony 2 php.ini date.timezone

Pat*_*cks 5 php symfony

我在xampp上设置Symfony 2 localy时遇到问题.安装没问题,但是当我执行check.php时,它说:

Your system is not ready to run Symfony2 projects 
 * date.timezone setting must be set
   > Set the "date.timezone" setting in php.ini* (like Europe/Paris).
Run Code Online (Sandbox Code Playgroud)

但是php.ini中的date.timezone已经正确设置了.

joh*_*ith 4

你可以将其添加到你的 AppKernel.php

public function init()
{
    // get rid of Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone
    date_default_timezone_set( 'Europe/Paris' );
    parent::init();
}
Run Code Online (Sandbox Code Playgroud)