We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    I’m not sure if this is a bug, an expected behavior, or if I left out a step.

    I decided to change the name of my database and the modx main folder after installing MODx Revolution.

    I renamed the db in phpMyAdmin, edited the config.inc.php file to match, and changed the name of the site folder.

    Then I did a new build.

    Then I ran a custom upgrade install, and entered the new db data. Everything checked out until the actual install when I got this message:

    Warning: modContext::include(C:/xampp/htdocs/addons/core/cache/mgr/context.cache.php) [function.modContext-include]: failed to open stream: No such file or directory in C:\xampp\htdocs\addons\core\model\modx\modcontext.class.php on line 49

    Warning: modContext::include() [function.include]: Failed opening ’C:/xampp/htdocs/addons/core/cache/mgr/context.cache.php’ for inclusion (include_path=’.;\xampp\php\pear\’) in C:\xampp\htdocs\addons\core\model\modx\modcontext.class.php on line 49

    Fatal error: Call to a member function execute() on a non-object in C:\xampp\htdocs\addons\core\model\modx\modx.class.php on line 2542

    A regular upgrade install failed also because the table prefix was already in use in the DB.

    Since the site was new, I emptied the DB and did a new install so all is well, but thought I should report the failures.
      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
      • 22303 MODX Staff
      • 10,725 Posts
      You forgot to edit the config.core.php in each root directory (including setup) to contain the changed core location. You must upgrade a "working" installation. If you edit the name of the directory before you run setup, and the configuration no longer works, setup will fail. It needs access to the core just like everything else.
        • 3749
        • 24,544 Posts
        Still confused. The config.core.php file in setup/includes if just the following:

        define ('MODX_CORE_PATH', MODX_INSTALL_PATH . 'core/');
        define ('MODX_CONFIG_KEY', 'config');
        define ('MODX_SETUP_KEY', '@svn');


        MODX_INSTALL_PATH is defined in index.php but it just sets it by doing this:

        $installPath= strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/';
        define('MODX_INSTALL_PATH', $installPath);


        The config.core.php in the root is already correct (maybe set by the build?).

        I can’t see anything to edit.
          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
          • 22303 MODX Staff
          • 10,725 Posts
          Did you not update the paths in core/config/config.inc.php ?
            • 3749
            • 24,544 Posts
            Quote from: OpenGeek at Sep 30, 2008, 02:10 PM

            Did you not update the paths in core/config/config.inc.php ?

            I’ll bet that’s it. They’re correct now (after the new install), but I don’t remember editing the paths there.

            Would it be possible to define those paths in abstract terms based on the current directory structure or to have them deduced from config.inc.php (or generated during the build based on config.inc.php)?


              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
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: BobRay at Sep 30, 2008, 04:30 PM

              I’ll bet that’s it. They’re correct now (after the new install), but I don’t remember editing the paths there.

              Would it be possible to define those paths in abstract terms based on the current directory structure or to have them deduced from config.inc.php (or generated during the build based on config.inc.php)?
              No, because this does not work in all configurations; one of the shortcomings in the current system IMO. This is why the installer now allows you to configure where the files would be installed if you were installing from the core.transport.zip (i.e. the advanced package), rather than directly from SVN or using the traditional package which includes all files in the traditional location.

              You should IOW use the installer to specify the locations and let it write the config file details. This does mean you have to edit a little more in the file to move it, but you do not have to run upgrades anymore (just empty the core/cache directory) when moving. Of course, you can still use the upgrade installation process during moves if you want to, and that will be easier for some folks.