0

I get "date_default_timezone_set(): Timezone ID '' is invalid" error suddenly on my running yii2 advanced project after clearing all data from database to upload to live server (Coincidentally, I know this has no relation). Same code is working on the live server but local computer(window xampp) show this error. I also tried changing the time zone from php.ini ...everything is fine. Other project also on yii2 advance are running fine. I also tried date_default_timezone_set('UTC'); in my file. I have searched for 2 days ..Everyone suggest to place timezone in php.ini or date_default_timezone_set('Asia/Kathmandu') on filedate. my php.ini portion looks like

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

error looks like: this I have looked at many question here like link,link

Community
  • 1
  • 1
Niras
  • 13
  • 5
  • Well it looks like something is picking up an empty string, which is indeed not a valid time zone ID. You're calling `Option::get('time_zone')` - where is *that* option being set. (I'm not a PHP dev, but it looks somewhat different to setting `date.timezone` in php.ini...) – Jon Skeet Mar 28 '17 at 06:18
  • Thank you .... After complete starting the same project and analysing gives me the result . LIke you said this is due to the option model. – Niras Mar 28 '17 at 06:45

1 Answers1

0

Actually,I found an solution. This error is due to clearing all data from database table before uploading to live server... accidentally i had deleted the data from option table (setting saved) that's why error occurred not Coincidentally. In my another server, I have not changed other table and updated only changed table so this server runs without error. To overcome this error, I have updated again this option table and everything fine. And this debugging created goes to senior developer Tej.Thank you Brother

Niras
  • 13
  • 5