lovedigit Posted May 13, 2013 Share Posted May 13, 2013 Hello, This is my first post on the website. Sorry, I din't went to the introduction section straight up. I am getting the following error on the website. The website was working fine before upgrading the php version. It would be a great help if someone could help me sort this out. I have searched many other forum and this seems to be right place to ask for help. You guys seems to have a giant active community. I don't have much knowledge about the php and stuff and I can't pay my developer to fix this Warning: Unknown: Invalid date.timezone value 'Asia/Calcuttaextension', we selected the timezone 'UTC' for now. in Unknown on line 0Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /home/user/public_html/fw/init.php:59 Stack trace: #0 /home/user/public_html/fw/init.php(59): DateTimeZone->__construct() #1 /home/user/public_html/fw/init.php(82): fw::connect(Array) #2 /home/user/public_html/application.php(17): fw::config(Array) #3 {main} thrown in /home/user/public_html/fw/init.php on line 59 # Database require FW.'db'.DIRECTORY_SEPARATOR.DB_ADAPTER.'.php'; db::connect(DB_HOST, DB_USER, DB_PASS); db::select_db(DB_NAME); # Timezone if(class_exists('DateTime')) { $date = new DateTime; if(method_exists($date, 'getOffset')) { $offset = $date->getOffset()/60; $minutes = abs($offset); $hours = floor($minutes/60); $minutes -= $hours*60; db::query('SET time_zone="'.sprintf('%+d:%02d', $hours*($minutes<0?-1:1), $minutes).'"'); } } } Quote Link to comment https://forums.phpfreaks.com/topic/277942-timezone-error-invalid-datetimezone-value-asiacalcuttaextension-we-selected-the-timezone-utc-for-now/ Share on other sites More sharing options...
kicken Posted May 13, 2013 Share Posted May 13, 2013 You're PHP setup has an invalid value for the date.timezone setting in php.ini. You need to determine what the correct setting should be and then update the php.ini and restart the server. Based on what you have, and the list at http://us1.php.net/manual/en/timezones.asia.php I'd say you probably want to set it to 'Asia/Calcutta' Quote Link to comment https://forums.phpfreaks.com/topic/277942-timezone-error-invalid-datetimezone-value-asiacalcuttaextension-we-selected-the-timezone-utc-for-now/#findComment-1429798 Share on other sites More sharing options...
lovedigit Posted May 14, 2013 Author Share Posted May 14, 2013 The Timezone issue has been fixed.I did the following:-->> Created the Customized php.ini file under the document root.-->> There was a problem with the 'Timezone' line in php.ini which I rectified.[date.timezone = "Asia/Calcutta"extension=pdo.so]Above lines must be in a seperate line which was earlier in the same line. Quote Link to comment https://forums.phpfreaks.com/topic/277942-timezone-error-invalid-datetimezone-value-asiacalcuttaextension-we-selected-the-timezone-utc-for-now/#findComment-1429954 Share on other sites More sharing options...
jazzman1 Posted May 14, 2013 Share Posted May 14, 2013 If you set date.timezone = "UTC" in your custom php.ini file by default you should get a current local time of the unix server (machine). Quote Link to comment https://forums.phpfreaks.com/topic/277942-timezone-error-invalid-datetimezone-value-asiacalcuttaextension-we-selected-the-timezone-utc-for-now/#findComment-1429958 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.