We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41051
    • 11 Posts
    Server is upgrading to PHP 5.5 from 5.3. Tested the upgrade ahead of time... by adding to the htaccess file:

    AddHandler application/x-httpd-php55 .php

    front end is fine, but /manager delivers 3 files all with the same error:

    ----
    Warning: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.
    ----

    manager/includes/rss.inc.php on line 49 =
    $pubdate = $modx->toDateFormat(strtotime($pubdate));

    manager/includes/document.parser.class.inc.php on line 2503 =
    $strTime = strftime($dateFormat . " %H:%M:%S", $timestamp);

    manager/actions/welcome.static.php on line 175 =
    $html.= "<tr bgcolor='#FFFFFF'><td><b>".$activeusers['username']."</b></td><td>$webicon ".abs($activeusers['internalKey'])."</td><td>".$activeusers['ip']."</td><td>".strftime('%H:%M:%S', $activeusers['lasthit']+$server_offset_time)."</td><td>$currentaction</td></tr>";
    }

    I saw an earlier post about using a php.ini file.. but that doesn't seem to work. Any ideas of how to fix these three files?





    This question has been answered by iusemodx. See the first response.

      • 16278
      • 928 Posts
      You can set the timezone via .htaccess as well.
      TLDR:
      <IfModule php5_module>
      php_value date.timezone "America/New_York"
      </IfModule>
      

      I think you should have hit this problem with PHP 5.3 earlier - or maybe that's using a different php.ini file?

      :) KP
        • 41051
        • 11 Posts

        I think you should have hit this problem with PHP 5.3 earlier - or maybe that's using a different php.ini file?

        ** It looks like there's a global php.ini file that I can't edit...

        The htaccess file includes:


        AddHandler application/x-httpd-php53 .php <-- I added this to keep it at 5.3

        #php_flag register_globals Off
        AddDefaultCharset utf-8
        #php_value date.timezone "America/New_York" <-- uncommenting leads to global server error


        <IfModule php5_module> <-- adding this doesn't fix it either.
        php_value date.timezone "America/New_York"
        </IfModule>

        • discuss.answer
          • 13226
          • 953 Posts
          If you are uploading a "php.ini" file you have to upload it to both the root and manager folders.

          If you already have a "php.ini" file on your server and you have the rights to modify it (dedicated server) you can add the date time zone to it.

          If your set-up doesn't have a "php.ini" file or you don't have the rights to modify it - upload a new file with the following in it:

          date.timezone = Europe/London


          If your timezone is different, you can view a list of valid timezones here

          I have tested this in the following environments: PHP 5.3, 5.4, 5.6
            • 41051
            • 11 Posts
            Quote from: iusemodx at Nov 25, 2015, 04:06 PM
            If you are uploading a "php.ini" file you have to upload it to both the root and manager folders.

            ** Okay that was my problem. php.ini file at root -- but not in the manager. Once I popped it in there with the time zone? The errors went away. THANK YOU!!!