Zaheer Babar
Zaheer Babar

Reputation: 1676

Set the "date.timezone" setting in php.ini

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

Upvotes: 2

Views: 16529

Answers (3)

Daniyal Saleem
Daniyal Saleem

Reputation: 83

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

Upvotes: 0

Edwin O.
Edwin O.

Reputation: 5276

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 !

Upvotes: 0

BentCoder
BentCoder

Reputation: 12730

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

Upvotes: 13

Related Questions