We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9674
    • 170 Posts
    Hi !

    Running a unix server with php 5.6 without trouble, I decided to try an update for a test account (running modx 2.3) with the CLI setup.

    My core is outside the web root, so I have to use advanced install and updates, and I am use to do it with the web interface.

    I ran :
    cd mywebroot/setup
    php ./index.php --installmode=upgrade-advanced
    as root user and install stop immediatly with :
    PHP Warning:  Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <h1>FATAL ERROR: MODX Setup cannot continue.</h1>
    <p>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 <a href="http://us.php.net/manual/en/timezones.php">here</a>.</p>
    </body>
    </html>
    


    I checked my php setting, of course safe mode is gone for a while, so not configured, and time zone properly setup as :
    date.timezone = "Europe/Paris"


    I tried next to upgrade through the classic browser install
     http://my-server.com/setup

    And it goes smoothly.

    Too bad, because I decided to create a shell to automate my accounts update....

    Anyway If this can help the dev team, I will be glad to make another trial.

    Long live modx !

    This question has been answered by multiple community members. See the first response.

    • discuss.answer
      Hi!

      PHP could have different configuration/ini file when running from the CLI or FPM (or whatever SAPI your server is using).
      Running `php -i | grep date.timezone` & `php -i | grep safe_mode` from the CLI should give you the setting values PHP CLI is using.

      Hope that will help.

      Cheers
        • 9674
        • 170 Posts
        Thanks Romain.

        Typing the command I realized that as runing a plesk panel what I use on command line is different from what I get under the web interface.

        Command line : OS version is php5.3.3 safe mode is on and timezone unset...
        Plesk environement is : php is 5.6.13 safe mode off (does not exist anymore), and timezone set to Europe/Paris.

        I will reconfigure Command Line php with proper information and check again.

        If it works , I will provide necessary information to reconfigure and mark the post as solved.

        Bon après-midi smiley

        Philippe

        [ed. note: Fildefer57 last edited this post 8 years, 7 months ago.]
        • discuss.answer
          • 9674
          • 170 Posts
          Hi !
          Since plesk use it's own php packages and setup, running a CLI install will fail due to differences in os default php.ini setup and plesk ones.

          In order to have the CLI install to work, I did the following changes in /etc/php.ini

          safe_mode = on
          with
          safe_mode = off


          ;date.timezone = 
          with
          date.timezone = Europe/Paris


          It does the trick....

          BUT !

          When trying to install with
          php ./index.php --installmode=upgrade-advanced

          I had html tag thrown out, to ask for the core....
          I then added
          php ./index.php --installmode=upgrade-advanced --core_path=/path/to/.../mypath/to/core

          (/path/to/.../mypath/to/core of course this is a fake path....)

          to get another html tag blast .... arguing that the path to core was wrong....
          So I give up for today.

          If anyone has already done a cli upgrade with advanced version AND a modify core path (and by the way also a manager name and path modified....), just let me know how you did it.


          Thanks Folks.
          • discuss.answer
            • 9674
            • 170 Posts
            Finally made it !
            error message are not exactly speaking...

            But :

            How to do modx CLI advanced install with modified path ?
            Solution :

            first create a config file in your setup directory, name it setup.xml (there are examples in the directory).
            Mine will look like :

            <modx>
            	<database_type>mysql</database_type>
                <database_server>localhost</database_server>
                <database>name-of-my-database</database>
                <database_user>user-to-connect-database</database_user>
                <database_password>password-to-connect-database</database_password>
                <database_connection_charset>utf8</database_connection_charset>
                <database_charset>utf8</database_charset>
                <database_collation>utf8_general_ci</database_collation>
                <table_prefix>my-modified-prefix-or-modx__</table_prefix>
                <https_port>443</https_port>
                <http_host>localhost</http_host>
                <cache_disabled>0</cache_disabled>
            
                <!-- Set this to 1 if you are using MODX from Git or extracted it from the full MODX package to the server prior
                     to installation. -->
                <inplace>0</inplace>
            
                <!-- Set this to 1 if you have manually extracted the core package from the file core/packages/core.transport.zip.
                     This will reduce the time it takes for the installation process on systems that do not allow the PHP time_limit
                     and Apache script execution time settings to be altered. -->
                <unpacked>0</unpacked>
            
                <!-- [b]The language to install MODX for[/b]. This will set the default manager language to this. Use IANA codes. -->
                <language>fr</language>
            
                <!-- Paths for your MODX core directory -->
                <core_path>path=/path/to/.../mypath/to/core/</core_path>
            
                <!-- Paths for the default contexts that are installed. -->
                <context_mgr_path>/path/to/.../mypath/to/httpdocs/manager/</context_mgr_path>
                <context_mgr_url>/manager/</context_mgr_url>
                <context_connectors_path>/path/to/.../mypath/to/httpdocs/connectors/</context_connectors_path>
                <context_connectors_url>/connectors/</context_connectors_url>
                <context_web_path>/path/to/.../mypath/to/httpdocs/</context_web_path>
                <context_web_url>/</context_web_url>
            
                <!-- Whether or not to remove the setup/ directory after installation. -->
                <remove_setup_directory>1</remove_setup_directory>
            </modx>


            then :

            php ./index.php --installmode=upgrade-advanced --core_path=/path/to/.../mypath/to/core


            Do not forget the --core_path, because it does not get it from the config file (why ?)

            And that's it !

            This way (painfull to learn), it works perfectly.

            Hope this will help you ;-)

            All the best !

            Philippe

            [Solved] [ed. note: Fildefer57 last edited this post 8 years, 7 months ago.]
              • 20413
              • 2,877 Posts
              THANKS FOR SHARING! NICE! smiley
                @hawproductions | http://mrhaw.com/

                Infograph: MODX Advanced Install in 7 steps:
                http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                • 3749
                • 24,544 Posts
                Do not forget the --core_path, because it does not get it from the config file (why ?)

                That's a really good question. I did some testing, and it appears that Setup ignores *all* the config.core.php files, even the one in setup/includes. I can't think of any reason for this.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 9674
                  • 170 Posts
                  As allways, modx community is doing fine and whith a good spirit.

                  Let's ask the why to dev team (Are you here ?).

                  Once again thanks to the modx community.