Jump to:

4938 Posts in 16244 Topics by 1490 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Error on install

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1241 Views
  • cruzer45
    Avatar
    Community Member
    9 Posts

    Error on install Link to this post

    Hi guys... I'm getting the following error when I try to install SS the error is below.
    Let me know what you think.

    [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 'America/Chicago' for '-6.0/no DST' instead
    POST /mr/install.php

    80     * Returns either the current system date as determined
    81     * by date(), or a mocked date through {@link set_mock_now()}.
    82     *
    83     * @return SS_Datetime
    84     */
    85    static function now() {
    86       if(self::$mock_now) {
    87          return self::$mock_now;
    88       } else {
    89          return DBField::create('SS_Datetime', date('Y-m-d H:i:s'));
    90       }
    91    }
    92    
    93    /**
    94     * Mock the system date temporarily, which is useful for time-based unit testing.
    95     * Use {@link clear_mock_now()} to revert to the current system date.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Error on install Link to this post

    Hi cruzer45,

    You need to edit your php.ini file in the local PHP installation, and look for "date.timezone". Uncomment it by removing the semi-colon in front of it and make it look like this:

    date.timezone = America/Chicago

    Once you've done that, restart the web server and try the SilverStripe installation again. It should work this time around.

    Sean

  • samu
    Avatar
    Community Member
    1 Post

    Re: Error on install Link to this post

    How do you handle that error on OS X? There's no php.ini at all. I added php.ini to /usr/local/lib/, with a line

    date.timezone = Pacific/Auckland


    then restarted the web server, with no luck.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Error on install Link to this post

    samu: Run this command in Terminal to find which php.ini file is loaded:

    php -i | grep php.ini

    Output should look something like this:

    Configuration File (php.ini) Path => /opt/local/etc/php5
    Loaded Configuration File => /opt/local/etc/php5/php.ini

    To confirm the date.timezone is being loaded correctly, Run this:

    php -i | grep date.timezone

    Output for that should look like this:

    date.timezone => Pacific/Auckland => Pacific/Auckland

    This is assuming the "php" command in the command line is the same one Apache is using.
    In my case, I'm using MacPorts to manage my Apache, PHP and MySQL stack.

    Cheers,
    Sean

  • cruzer45
    Avatar
    Community Member
    9 Posts

    Re: Error on install Link to this post

    Thanks guys.

    As an alternative I did the following :

    Add the following line to index.php and sapphire/main.php

    date_default_timezone_set("America/Belize");

    That is a workaround if you don't have the ability to restart your webserver.

    1241 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.