Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony 2 php.ini date.timezone

Tags:

php

symfony

I have a problem with the setup of Symfony 2 localy on xampp. The installation was no problem but when I execute the check.php it says:

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).

But the date.timezone in the php.ini is already set correctly.

like image 260
Patricks Avatar asked Sep 29 '22 23:09

Patricks


1 Answers

you can add this to your 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();
}
like image 64
john Smith Avatar answered Oct 18 '22 15:10

john Smith