We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29190
    • 6 Posts
    Hello everybody

    I am trying to install modx on a Ubuntu 10.04 32bit Virtual Private Server.

    When I browse to the setup/ folder I see the following:

    FATAL ERROR: MODx Setup cannot continue.

    To use PHP 5.3.0+, you must set the date.timezone setting in your php.ini. Please do set it to a proper timezone before proceeding. A list can be found here.

    Some background about the server/system

    • Server: Virtual Server running Ubuntu 10.04 32 bit
    • Web server: Apache(2)/2.2.14
    • MySQl Version 14.14 Distrib 5.1.41
    • PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch (cli)
    • MODx Revolution 2.0.7

    Naturally I figured I should find my php.ini and set the date.timezone.
    When I ran
    find -name php.ini

    I recieved the following

    ./etc/php5/apache2/php.ini
    ./etc/php5/cgi/php.ini
    ./etc/php5/cli/php.ini

    As I don’t really know which one that matters I placed the following code in all three files
    date_default_timezone_set("Europe/Stockholm");


    That didn’t seem to do the trick so I set the servers timezone by running
    dpkg-reconfigure tzdata

    and I set my timezone to Europe/Stockholm and still no success..

    I suspect that I did something wrong when I placed the line of code in the php.ini files as I recieved an error message when I ran php -v to show the version I have for this post. The error message when I ran php -v
    PHP:  syntax error, unexpected '(' in /etc/php5/cli/php.ini on line 94
    PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf
    .d/mcrypt.ini on line 1 in Unknown on line 0
    PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch (cli) (built: Jan 12 2011 18:36:08)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    root@utveckling:/etc/php5#
    



    I hope that you understand my problem and that you can help me solve this. Any and all help will be greatly apreciated!

    Mind you that I am fairly new to Linux and server configuration as well so don’t be afraid to explain things as if I was a five year old =)

    Best regards
    /Taher
      • 2740
      • 95 Posts
      Whilst you are waiting for a more helpful reply, you could try including a timezone in your .htaccess file. For example:

      SetEnv TZ Europe/London
        • 29190
        • 6 Posts
        Thank you Stratton for your looking at my problem!

        My .htaccess looked as follows:
        #
        For full documentation and other suggested options, please see
        # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
        # including for unexpected logouts in multi-server/cloud environments
        
        Options +FollowSymlinks
        # RewriteEngine On
        # RewriteBase /
        
        # Fix Apache internal dummy connections from breaking [(site_url)] cache
        RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
        RewriteRule .* - [F,L]
        
        # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
        #RewriteCond %{HTTP_HOST} .
        #RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
        #RewriteRule (.*) http://www.example.com/$1 [R=301,L]
        
        # Exclude /assets and /manager directories from rewrite rules
        RewriteRule ^(manager|assets) - [L]
        
        # For Friendly URLs
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        
        # Reduce server overhead by enabling output compression if supported.
        #php_flag zlib.output_compression On
        #php_value zlib.output_compression_level 5
        
        php_value date.timezone Europe/Stockholm
        ~
        



        I have now changed it so that it looks like this:
        # For full documentation and other suggested options, please see
        # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
        # including for unexpected logouts in multi-server/cloud environments
        
        Options +FollowSymlinks
        # RewriteEngine On
        # RewriteBase /
        
        # Fix Apache internal dummy connections from breaking [(site_url)] cache
        RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
        RewriteRule .* - [F,L]
        
        # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
        #RewriteCond %{HTTP_HOST} .
        #RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
        #RewriteRule (.*) http://www.example.com/$1 [R=301,L]
        
        # Exclude /assets and /manager directories from rewrite rules
        RewriteRule ^(manager|assets) - [L]
        
        # For Friendly URLs
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        
        # Reduce server overhead by enabling output compression if supported.
        #php_flag zlib.output_compression On
        #php_value zlib.output_compression_level 5
        
        # php_value date.timezone Europe/Stockholm
        
        SetEnv TZ Europe/Stockholm
        ~
        


        I have restarted the apache2 server as well. Still no difference =/

        I am open to more suggestions!


          • 29190
          • 6 Posts
          Might I ask that someone who runs their modx revolution 2.07 on a Linux private server post the section of their php.ini files that contain date.timezone = ...

          It would be a good help for me to find the reason why I have this issue.

          Best regards!
          /Taher
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone

            The user comments at the bottom have a couple of examples.
              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
              • 29190
              • 6 Posts
              Thanx I found that page updated my php.ini so that it looks like the German example, still no joy so maybe I should expand my question a little.

              If you run
              find -name php.ini

              what do you get?

              When you look at the [Date] section in your php.ini files do you:
              have time-zone set?
              have latitude and longtitude set?
              Does that go for all (three?) files?
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                If you run a script with just
                <?php
                phpinfo();
                ?>
                

                you’ll be able to find where the php.ini file is located. You may also be able to simply put a php.ini file with the appropriate setting in the directories involved. I’m not sure what directories that would need to be in Revo to work on the setup script.
                  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
                  • 29190
                  • 6 Posts
                  I’m sorry, I don’t quite follow

                  I can place a php.ini file in the /setup catalog and that one will be used???


                  I found this in the result from the script you mentioned:

                  Additional .ini files parsed

                  • /etc/php5/apache2/conf.d/curl.ini,
                  • /etc/php5/apache2/conf.d/gd.ini,
                  • /etc/php5/apache2/conf.d/mcrypt.ini,
                  • /etc/php5/apache2/conf.d/mysql.ini,
                  • /etc/php5/apache2/conf.d/mysqli.ini,
                  • /etc/php5/apache2/conf.d/pdo.ini,
                  • /etc/php5/apache2/conf.d/pdo_mysql.ini

                  Should I check all of those .ini files as well for date-serttings??

                  I feel disoriented in a dark room here.. huh
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    No, you’re only looking for the php.ini file that’s actually being loaded (used). In the first block, you should see a line "Loaded Configuration File " and then a path. There will be a couple of other lines there as well; "Configuration File (php.ini) Path " which is the default location of the php.ini file (in my case the default is /etc, but it’s loading the one from /home2/sottwell/public_html/php.ini)
                      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
                      • 29190
                      • 6 Posts
                      When I look at the output from the script you wrote this is (part of) what I see:

                      [table]
                      [tr]
                      [td]Configuration File (php.ini) Path[/td]
                      [td]/etc/php5/apache2[/td]
                      [/tr]
                      [tr]
                      [td]Loaded Configuration File [/td]
                      [td]/etc/php5/apache2/php.ini [/td]
                      [/tr]
                      [tr]
                      [td]Scan this dir for additional .ini files [/td]
                      [td]/etc/php5/apache2/conf.d [/td]
                      [/tr]
                      [tr]
                      [td]Additional .ini files parsed [/td]
                      [td]

                      • /etc/php5/apache2/conf.d/curl.ini,
                      • /etc/php5/apache2/conf.d/gd.ini,
                      • /etc/php5/apache2/conf.d/mcrypt.ini,
                      • /etc/php5/apache2/conf.d/mysql.ini,
                      • /etc/php5/apache2/conf.d/mysqli.ini,
                      • /etc/php5/apache2/conf.d/pdo.ini,
                      • /etc/php5/apache2/conf.d/pdo_mysql.ini

                      [/td]
                      [/tr]
                      [/table]

                      The date section of /etc/php5/apache2/php.ini looks as follows:
                      [Date]

                      date.timezone = "Europe/Berlin"
                      date.default_latitude = 52.5194
                      date.default_longitude = 13.4067


                      Even though I don’t live in Germany I figured I should try to get it wrking first and the correct the data..

                      If I understand you correctly this is the way it’s supposed to be huh
                      I have restarted Apache as well..

                      What am I missing?

                      How do I best test if php returns the date.timezone value?