Symfony 2 php.ini date.timezone

I have a problem setting the Symfony 2 location on xampp. Installation was not a problem, but when I execute 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 .timezone date in php.ini is already configured correctly.

+5
source share
4 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 timezone date_default_timezone_set( 'Europe/Paris' ); parent::init(); } 
+4
source

for some reason you should change date.timezone to

php.ini

in

cli folder

got a hint when I tried to start a new project in Symfony3.

even if phpinfo () shows that

The php.ini file is located in the apache2 folder

+2
source

If you have the following problem:

 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) 

Just replace | localizeddate ('long', 'long') on | date ('r') in the file app / Resources / views / base.html.twig.

0
source

What worked for me was to add the -k option when restarting Apache

-2
source

Source: https://habr.com/ru/post/1211415/


All Articles