We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9149
    • 19 Posts
    I just upgraded one of my sites to 1.0.2 and although the site functions fine, I am receiving the following errors in the Manager (and when I attempt to login through the /manager screen, I get a pop-up error that prevents me from accessing the Manager, though if I access one of the site pages I can get into the Manager that way).

    Anyway, the errors I am seeing are:

    Warning: strtotime() [function.strtotime]: 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 ’PST/-8.0/no DST’ instead in /usr/local/home/pen-ne/www/manager/includes/rss.inc.php on line 50

    Warning: strftime() [function.strftime]: 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 ’PST/-8.0/no DST’ instead in /usr/local/home/pen-ne/www/manager/includes/document.parser.class.inc.php on line 1768


    I definitely have the correct time zone offset configured in the site configuration (server is on West Coast, we are on East Coast, so I set it to +3).

    Any help would be greatly appreciated.

    Thanks,
    Michael
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      This has to do with your PHP environment, not MODx:
      http://php.net/manual/en/function.date-default-timezone-set.php
      You could add this function to the config.inc.php file, or even to the index.php files.

      You can also set this in a .htaccess file so it’s valid for all PHP scripts
      php_value date.timezone 'America/New_York'


        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 9149
        • 19 Posts
        Thank you, Susan. I’m not an experienced PHP coder. How should that be written if I am adding it to the config.inc.php file?

        I also noticed that I’m now getting this error when accessing /manager to login:

        Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/local/home/pen-ne/www/manager/includes/config.inc.php:1) in /usr/local/home/pen-ne/www/manager/includes/config.inc.php on line 60
        
        Warning: Cannot modify header information - headers already sent by (output started at /usr/local/home/pen-ne/www/manager/includes/config.inc.php:1) in /usr/local/home/pen-ne/www/manager/includes/config.inc.php on line 74
        
        Warning: Cannot modify header information - headers already sent by (output started at /usr/local/home/pen-ne/www/manager/includes/config.inc.php:1) in /usr/local/home/pen-ne/www/manager/index.php on line 168


        Are these also PHP problems outside of MODx? The hosting provider recently upgraded PHP (without letting us know), and I worry that may have something to do with it.

        Thanks again,
        Michael
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Sounds like you need to have a chat with your hosting company’s help desk about the session issue (the rest of the errors are just the result of the PHP session error being sent by PHP before MODx tries to send its own stuff).

          As far as adding the default_timezone_set function, it should look like this:
          date_default_timezone_set('America/Los_Angeles');

          Note the quotes around the setting inside the parentheses and the ending semicolon.

          Check this page for valid settings http://www.php.net/manual/en/timezones.php
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 9149
            • 19 Posts
            Great! Thanks again for your help.

            Michael