2

I have set date.timezone in php.ini also in appKernal. Also php app/check.php giving following message.

(Your system is ready to run Symfony2 projects)

But when I access web/config.php, it is giving following result:

Major problems have been detected and must be fixed before continuing: Set the date.timezone setting in php.ini* (like Europe/Paris).

Zaheer Babar
  • 1,636
  • 1
  • 15
  • 17

3 Answers3

13

If you're a Linux user do these in both files. I had the same issue before and sorted with:

sudo nano /etc/php5/apache2/php.ini
sudo nano /etc/php5/cli/php.ini

With something like below:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/London

EDIT: Like pointed out comment below there is FPM too so:

sudo nano /etc/php5/fpm/php.ini
BentCoder
  • 12,257
  • 22
  • 93
  • 165
  • 4
    As above, command line and web-served PHP will be reading different configs. Location of php.ini file will depend on which type of PHP you're using. For PHP-FPM it's /etc/php5/fpm/php.ini – AJ Cerqueti Feb 05 '15 at 12:06
  • @AJCerqueti - That's correct! I added it into the answer. – BentCoder Feb 05 '15 at 12:08
  • The list of datetime zones [here](http://php.net/manual/es/timezones.america.php) – Emaus Mar 06 '17 at 10:38
0

this worked for me !

in terminal do sudo vi /usr/local/etc/php/7.1/php.ini make sure to change 7.1 to your php version

search for date.timezone

change from

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

to

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/Berlin

and restart php... since i am using mac and installed with brew, i restart by the following command sudo brew services restart php71

then try again !

Edwin O.
  • 4,998
  • 41
  • 44
0

For Windows

  1. You have to edit the php.ini file.

    - You can find the PHP installation path by opening CMD and typing where php

    - php.ini can be found in the same folder

  1. Just open the php.ini file in a text editor.
  2. search for date.timezone

CHANGE

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

TO

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/Berlin