We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2878
    • 81 Posts
    I did a new install on local using XAMPP.
    All was fine until login when I received the following warning.
    <br />
    <b>Warning</b>:  date() [<a href='function.date'>function.date</a>]: 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 'Europe/Paris' for '1.0/no DST' instead in <b>C:\xampplite\htdocs\WBV\manager\includes\document.parser.class.inc.php(746) : eval()'d code</b> on line <b>33</b><br />


    I searched the forum and found one listing of this with no fix.
    I had a similar problem when instaliing and creating a Wordpress template locally.
    In the case of the Wordpress problem all I needed to do was add this line of code. >
    date_default_timezone_set('America/New_York'); 
    Into the wp-config.php file
    and it fixed everything. Is there a similar fix? I Don’t want to re-intall XAMPP and have it mess up other projects already started.

    I’m sure I’ll have many more annoying questions as I try to build my own template to work with inside modx.


    Thank you,
    bauhaus9
      • 26903
      • 1,336 Posts
      Set this value ’date.timezone setting’ in your php.ini file and restart your server, this will fix the timezone across all sites served from it rather than setting it individually in each app.
        Use MODx, or the cat gets it!
        • 2878
        • 81 Posts
        Thank you for your reply.

        Is this what you mean???
        [Date]
        ; Defines the default timezone used by the date functions
        ; http://php.net/date.timezone
        ;date.timezone setting


        here is the code before.
        [Date]
        ; Defines the default timezone used by the date functions
        ; http://php.net/date.timezone
        ;date.timezone =


        I’ve even tried everything on this page. > http://bobsguides.com/modx-installation-faq.html

        And the only thing that works is viewing the main home page every thing else dose not work??? I really can’t believe this is that hard to find an answer to. I’ve been searching for hours.

        Any help is much appreciated.
        bauhaus9
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          An example given in the user comment to the page in the PHP manual linked to in the php.ini section that you quoted:
          date.timezone = "Asia/Shanghai"
          You can find an appropriate setting to use here 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
            • 2878
            • 81 Posts
            Quote from: sottwell at Jun 23, 2010, 12:28 AM

            An example given in the user comment to the page in the PHP manual linked to in the php.ini section that you quoted:
            date.timezone = "Asia/Shanghai"
            You can find an appropriate setting to use here http://www.php.net/manual/en/timezones.php

            I have made changes to the php.ini file located in C:\xampplite\php
            Here is what it looks like now. >
            [Date]
            ; Defines the default timezone used by the date functions
            ; http://php.net/date.timezone
            ;date.timezone = "America/New_York"
            
            ; http://php.net/date.default-latitude
            ;date.default_latitude = 31.7667
            
            ; http://php.net/date.default-longitude
            ;date.default_longitude = 35.2333
            
            ; http://php.net/date.sunrise-zenith
            ;date.sunrise_zenith = 90.583333
            
            ; http://php.net/date.sunset-zenith
            ;date.sunset_zenith = 90.583333
            
            [filter]
            ; http://php.net/filter.default
            ;filter.default = unsafe_raw
            
            ; http://php.net/filter.default-flags
            ;filter.default_flags =


            But I still get the same error when trying to log into modx. >
            br />
            <b>Warning</b>:  date() [<a href='function.date'>function.date</a>]: 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/New_York' for '-4.0/DST' instead in <b>C:\xampplite\htdocs\Bones_of_PA_Site\manager\includes\document.parser.class.inc.php(746) : eval()'d code</b> on line <b>41</b><br />
            <br />
            <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at C:\xampplite\htdocs\Bones_of_PA_Site\manager\includes\document.parser.class.inc.php:757) in <b>C:\xampplite\htdocs\Bones_of_PA_Site\manager\processors\login.processor.php</b> on line <b>264</b><br />
            Location: http://localhost/Bones_of_PA_Site/manager/

            After getting the warning I can click on My Modx Site and see the home page "Welcome to MODx" and Install Successful! But if I click on any of the links I get a page like this.
            Object not found!
            
            The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
            
            If you think this is a server error, please contact the webmaster.
            Error 404
            localhost
            06/23/10 12:38:52
            Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 

            huh
            My php abilities are in their infancy I can use all the guidance I can get.
            Thanks again.
            bauhaus9

              • 26903
              • 1,336 Posts
              Have you restarted the web server? You won’t see changes to php.ini until you do
                Use MODx, or the cat gets it!
                • 2878
                • 81 Posts
                Quote from: shamblett at Jun 23, 2010, 12:42 PM

                Have you restarted the web server? You won’t see changes to php.ini until you do

                By restarting, if you mean turning on and off the Apache and MySql in the XAMPP control panel then yes I have done this several times.

                I’ve also added
                #php_flag register_globals Off
                #AddDefaultCharset utf-8
                #php_value date.timezone America/New_York
                SetEnv TZ America/New_York

                SetEnv TZ America/New_York
                The text in red to the ht.acess file in the root directory but still get a warning on log-in along with a warning of offset time in the manager interface.

                What am I missing?? >:(
                  • 2878
                  • 81 Posts
                  Just did another fresh install after turning off and on XAMPP panel
                  with the changes in the php.ini and ht.access. I still get the very first warning above on login, but no everything in the manager does not have it included.

                  Server offset time panel is the following. >
                  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/New_York' for '-4.0/DST' instead in C:\xampplite\htdocs\Bones_of_PA_Site\manager\actions\mutate_settings.dynamic.php  on line 507
                  
                  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/New_York' for '-4.0/DST' instead in C:\xampplite\htdocs\Bones_of_PA_Site\manager\actions\mutate_settings.dynamic.php on line 507
                  Select the number of hours time difference between where you are and where the server is. Current time on server is [13:56:59], current time on server using the currently saved offset is [13:56:59].


                  When I go to Tools -> System Configuration and make changes I get rows of this. >
                  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/New_York' for '-4.0/DST' instead in C:\xampplite\htdocs\Bones_of_PA_Site\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/New_York' for '-4.0/DST' instead in C:\xampplite\htdocs\Bones_of_PA_Site\manager\includes\document.parser.class.inc.php on line 1775


                  And if I try to view localhost/modxsite/index.php i get this page. >
                  « MODx Parse Error »
                  MODx encountered the following error while attempting to parse the requested resource:
                  « PHP Parse Error »
                   
                  PHP error debug
                    Error: 	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/New_York' for '-4.0/DST' instead	 
                    Error type/ Nr.: 	Warning - 2	 
                    File: 	C:\xampplite\htdocs\Bones_of_PA_Site\manager\includes\document.parser.class.inc.php(770) : eval()'d code	 
                    Line: 	453	 
                   
                  Parser timing
                    MySQL: 	0.0148 s	(11 Requests)
                    PHP: 	0.0730 s	 
                    Total: 	0.0878 s

                  Why is this still happening. Insert smiley icon with gun to head! :’(
                    • 2878
                    • 81 Posts
                    I am very happy to say that I found a solution.
                    And it was my lack of knowledge of php coding that caused the problem. embarrassed embarrassed embarrassed
                    I now have the php.ini file working and all is well.

                    Thank yous to shamblett and sottwell for trying to assist me.

                    And everyone please keep in mind when I ask a (stupid) question I’m a newb at php.

                    bauhaus9
                      • 4184
                      • 4 Posts
                      This is the exact same problem that I am having. Bauhua, you say you found the solution then why didn’t you post it for others that are having the same problem. Could you or someone else post the solution? I’ve tried evolution and revolution and both have this error message so please if someone can post a solution I and I’m sure others would be grateful.


                      Thanks.
                      Bryan