#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    2
    Rep Power
    0

    You are *required* to use the date.timezone setting or the date_default_timezone_set


    So I wasn't sure if this is the right place to post this, but I have been trying to figure out the above error all morning. Did a lot of googling, editing httpd.conf, restarting apache but I cannot get that error to go away.

    Building a box with snort, mysql and BASE on it. When I log into BASE, I see those lovely date.timezone messages and cannot get them to go away.

    I tried putting in the correct info in my php.ini file, restarting apache but still no luck.

    I put in:

    Code:
    date.timezone = "America/Los_Angeles"
    That did not work so I created a test.php file to see the configuration of the server.

    I confirmed it is reading the right configuration file.

    Under the DATE section when viewing the php.info page, I see this:

    Code:
    Warning: phpinfo() [function.phpinfo]: 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 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/www/apache22/data/test.php on line 2
    This is the contents of my test.php file:

    Code:
    <?php
    phpinfo();
    ?>
    Just for reference, these are some sample errors I am getting when I view the BASE web interface:

    Code:
    Warning: date() [function.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 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/www/base/base_main.php on line 138
    
    Warning: date() [function.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 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/www/base/base_main.php on line 139
    Anyone have any suggestions?

    I appreciate it.

    TCG
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    You say that PHP is reading the correct php.ini file, yet the error message you gave indicates that PHP is seeing a date.timezone value of 'PDT/-7.0/DST'

    See where it says exactly that in the error message? The message is saying:
    "You can't use the system time. You have to tell us what time zone you're in. You've told us 'PDT/-7.0/DST' but that's not right, so we're using America/Los_Angeles. You still need to fix it, but this is just a warning."

    Switch to Eastern time, see if php.ini changes to match.

    -Dan
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    2
    Rep Power
    0
    Originally Posted by ManiacDan
    You say that PHP is reading the correct php.ini file, yet the error message you gave indicates that PHP is seeing a date.timezone value of 'PDT/-7.0/DST'

    See where it says exactly that in the error message? The message is saying:
    "You can't use the system time. You have to tell us what time zone you're in. You've told us 'PDT/-7.0/DST' but that's not right, so we're using America/Los_Angeles. You still need to fix it, but this is just a warning."

    Switch to Eastern time, see if php.ini changes to match.

    -Dan
    Ahh, good call.
    I made the changes and it is not reflecting when I load the test page. It is still showing 'America/Los_Angeles'.

    I thought I would take the snippet from the php config page:

    Code:
    Warning: phpinfo() [function.phpinfo]: 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 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/www/apache22/data/test.php on line 2
    date/time support	enabled
    "Olson" Timezone Database Version	2011.4
    Timezone Database	internal
    Default timezone	America/Los_Angeles
    
    Directive	Local Value	Master Value
    date.default_latitude	31.7667	31.7667
    date.default_longitude	35.2333	35.2333
    date.sunrise_zenith	90.583333	90.583333
    date.sunset_zenith	90.583333	90.583333
    date.timezone	no value	no value
    I am editing the php.ini file located in:

    /usr/local/etc/

    Which, according to the PHP.INFO page, is where it is reading this from.

    So I am a little confused on what and why this is occuring.

    Thank you for the help.

    TCG
  6. #4
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Are you restarting the web server when you edit php.ini?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo