Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: require_once(): It is not safe to rely on the system's timezone settingserror in PHP

Tags:

php

I am trying to install a open source PHP application IIS; after installation I am getting the following error:

Warning: require_once(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Kolkata' for '5.5/no DST' instead in D:\Inetpub\wwwroot\dotproject\lib\adodb\adodb.inc.php

like image 573
Krishna Kumar Avatar asked Jul 23 '10 11:07

Krishna Kumar


1 Answers

This has nothing to do with require_once() but with the time/date function you're using in the included script.

see http://docs.php.net/datetime.configuration#ini.date.timezone and http://docs.php.net/timezones

Simplest solution: Put

date.timezone = "Asia/Kolkata"

into your php.ini. Use

<?php echo get_cfg_var('cfg_file_path');

to determine which php.ini you have to edit.

like image 169
VolkerK Avatar answered Oct 20 '22 09:10

VolkerK