We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34174
    • 67 Posts
    Hi, I had just successfully upgraded to 2.5.4 from 2.5.0 and was trying to upgrade to 2.5.7. I was using UpgradeMODX but I also tried to do this manually and still got the same error.

    Never got anything like it.

    Any ideas? Thanks.
      • 38783
      • 571 Posts
      Is the MODX 'core' directory stored outside of the web root?
        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 34174
        • 67 Posts
        Quote from: andytough at May 08, 2017, 09:16 PM
        Is the MODX 'core' directory stored outside of the web root?

        Thanks Andy - no it isn't.
          • 42562
          • 1,145 Posts
          donshakespeare Reply #4, 7 years ago
          I bet there is no such folder home/en
          And besides it is not within your rightful shared hosting public_html (I am assuming this is some kind of shared hosting)

          When do you get this error?
          Does this error prevent Upgrade?
          Are you able to access anything in the Manager?
            TinymceWrapper: Complete back/frontend content solution.
            Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
            5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
            • 34174
            • 67 Posts
            Correct, there is no /home/en. I don't know why the setup file(s) would be looking there.

            I get the error when I try to launch the upgrade from 2.5.4 to 2.5.7.

            Yes I can access the manager just fine but since I unpacked the modx-2.5.7 setup files into my system, I don't know if there's any danger in that.

            I guess I should try to unpack the 2.5.4 files and see if I can reinstall that?
              • 42562
              • 1,145 Posts
              donshakespeare Reply #6, 7 years ago
              By chance, are using some multilingual setup, in htaccess, or index.html/php, or Babel, etc?
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • 34174
                • 67 Posts
                No multilingual on this site.
                  • 3749
                  • 24,544 Posts
                  I'm guessing that the second line here is where the problem is coming from (in setup/controllers/language.php):

                  $cookiePath = preg_replace('#[/\\\\]$#', '', dirname(dirname($_SERVER['REQUEST_URI'])));
                      setcookie('modx_setup_language', $language, 0, $cookiePath . '/');
                  


                  You might try putting this between the two lines:

                  echo "<br>Request URI: " . $_SERVER['REQUEST_URI'];
                  echo "<br>Cookie Path: " . $cookiePath;


                  If you have access to the Manager, you could set the current version setting in UpgradeMODX back to 2.5.0. I think that would let you use UGM to "upgrade" to 2.5.4. If that works, you could try the real upgrade again in case the download was corrupted.
                    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
                    • 34174
                    • 67 Posts
                    Here's how I had to cheat to fix the problem, and to get a working 2.5.7.

                    Don't know why I had to do it but we'll see when there is 2.5.8 is out, if that upgrade will go smoothly.

                    <?php
                    /**
                     * @var modInstall $install
                     * @var modInstallParser $parser
                     * @var modInstallRequest $this
                     * @package setup
                     */
                    /* parse language selection */
                    if (!empty($_POST['proceed'])) {
                        $language= 'en';
                        $cookiePath = preg_replace('#[/\\\\]$#', '', dirname(dirname($_SERVER['REQUEST_URI'])));
                        
                        // ============================================
                        // this is the single line I inserted:
                        unset($_REQUEST['language']);
                    
                        if (isset($_REQUEST['language']) && is_dir($cookiePath . '/' . $_REQUEST['language'])) {
                            $language= $_REQUEST['language'];
                        }
                        setcookie('modx_setup_language', $language, 0, $cookiePath . '/');
                        unset($_POST['proceed']);
                        $settings = $install->request->getConfig();
                        $settings = array_merge($settings,$_POST);
                        $install->settings->store($settings);
                        $this->proceed('welcome');
                    }
                    
                    $install->settings->erase();
                    
                    $langs = $install->lexicon->getLanguageList();
                    $parser->set('langs', $langs);
                    
                    $actualLanguage = $install->lexicon->getLanguage();
                    $languages = '';
                    foreach ($langs as $language) {
                        $languages .= '<option value="'.$language.'"'
                            .($language == $actualLanguage ? ' selected="selected"' : '')
                            .'>' . $language . '</option>' . "\n";
                    }
                    $parser->set('languages',$languages);
                    
                    $parser->set('restarted', !empty($_REQUEST['restarted']));
                    
                    return $parser->render('language.tpl');