date_default_timezone_set Error on first logi

Setup
2010-01-13
2013-06-05
  • Mafaz Mazeen
    Mafaz Mazeen
    2010-01-13

    Hi,

    I have installed OrangeHRM on my Fedora 12 server running apache and mySQL. On my first logon I received this error;

        Warning

        date(): 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 'UTC' for 'GMT/0.0/no DST' instead

        Technical Details

        Encountered the problem in /var/www/html/index.php Line 585
        System Environment

        OrangeHRM : 2.5.0.2
        PHP : 5.3.1
        MySQL Client : 5.1.41
        Memory limit : 128M
        Maximum session lifetime : 1440
        Please note

        The error was logged in the OrangeHRM log located in /var/www/html/lib/logs/logDB.txt
        If you are unable to resolve the problem please post the problem in OrangeHRM Forum

    I attempted to resolve this by adding

    Code: Select all
        date_default_timezone_set('Europe/London');

    to php.ini which resulted in the following error;

        Warning: date() : 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 'UTC' for 'GMT/0.0/no DST' instead in /var/www/html/lib/exception/ExceptionHandler.php on line 99

        Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/lib/exception/ExceptionHandler.php:99) in /var/www/html/lib/exception/ExceptionHandler.php on line 130
        Warning warning /var/www/html orange

    and I also tried

    Code: Select all
        date_default_timezone_set('UTC');

    which gave the same error. Any ideas?

     
  • Mafaz Mazeen
    Mafaz Mazeen
    2010-03-15

    Hi Seb Spiers, :)

    I met the same problem and here is the great solution:

    edit ..xampp\htdocs\orangehrm\lib\confs\sysConf.php

    adding this: date_default_timezone_set("YOUR REGION/YOUR CITY"); to first line in function sysConf() {

    and please ensure you've insert a proper string, you can find all this string here: http://nl3.php.net/manual/en/timezones.php

    Now refresh your page.. :) you should get rid of the error!!

    Thank,
    Omni