We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54187
    • 16 Posts
    I've exported the database from the live website, imported the database export into local mampserver phpMyAdmin, downloaded the files from the live website, unzipped them into local vhost directory, edited /webroot/config.core.php & /webroot/core/config/config.inc.php with new paths to folders and base URL.

    I've created the vhost, restarted Apache, added a hosts file entry.

    When I load the local URL, I receive the error:

    Fatal error: Uncaught Error: Call to a member function processElementTags() on null in /Applications/AMPPS/www/old.insightdesign.local/core/model/modx/modresponse.class.php:83 Stack trace: #0 /Applications/AMPPS/www/old.insightdesign.local/core/model/modx/modrequest.class.php(145): modResponse->outputContent(Array) #1 /Applications/AMPPS/www/old.insightdesign.local/core/model/modx/modrequest.class.php(129): modRequest->prepareResponse() #2 /Applications/AMPPS/www/old.insightdesign.local/core/model/modx/modx.class.php(1404): modRequest->handleRequest() #3 /Applications/AMPPS/www/old.insightdesign.local/index.php(69): modX->handleRequest() #4 {main} thrown in /Applications/AMPPS/www/old.insightdesign.local/core/model/modx/modresponse.class.php on line 83


    Line 80 - 84 of /core/model/modx/modresponse.class.php is:

    /* collect any uncached element tags in the content and process them */
    $this->modx->getParser();
    $maxIterations= intval($this->modx->getOption('parser_max_iterations', $options, 10));
    $this->modx->parser->processElementTags('', $this->modx->resource->_output, true, false, '[[', ']]', array(), $maxIterations);
    $this->modx->parser->processElementTags('', $this->modx->resource->_output, true, true, '[[', ']]', array(), $maxIterations);


    Help appreciated.

    Steve

      • 54187
      • 16 Posts
      I found the value of the live URL in the local database, in table prefix_modx_context_setting, under site_url & http_host. I edited these to the local URL, and the same error occurs on the front end of the local website.
        • 3749
        • 24,544 Posts
        You also need to edit the config.core.php files in the connectors and manager directories.

        Make sure mod_rewrite is enabled on your local server. Uncomment this, if necessary:

        LoadModule rewrite_module modules/mod_rewrite.so
          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
          • 54187
          • 16 Posts
          Thanks Bob,

          I've edited config.core.php in the connectors and manager directories, and confirmed mod_rewrite is enabled.

          The same error remains on the home page.
            • 3749
            • 24,544 Posts
            Try deleting all files in the core/cache directory and running setup. You can download the exact same version and unzip it to get the setup directory.

            If the site is in a subdirectory, you may need to specify it in the RewriteBase line in .htaccess. (Also, check .htaccess for stuff that's specific to the remote site.) Be sure it ends in a slash. All paths in the config files should also end with a slash.

            On some local installs, I've had to hard-code the full path to the MODX core directory in the three config.core.php files and in the config.inc.php file.
              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
              • 54187
              • 16 Posts
              Thanks Bob.

              I've deleted the contents of /core/cache.

              When I run setup, I receive:

              Warning: array_merge(): Argument #2 is not an array in /Applications/AMPPS/www/old.example.local/core/xpdo/xpdo.class.php on line 340

              Fatal error: Uncaught Error: Class 'xPDODriver_' not found in /Applications/AMPPS/www/old.example.local/core/xpdo/xpdo.class.php:1867 Stack trace: #0 /Applications/AMPPS/www/old.example.local/core/xpdo/xpdo.class.php(341): xPDO->getDriver() #1 /Applications/AMPPS/www/old.example.local/setup/includes/modinstall.class.php(458): xPDO->__construct(NULL, NULL, NULL, Array, Array) #2 /Applications/AMPPS/www/old.example.local/setup/includes/modinstall.class.php(171): modInstall->_connect(NULL, NULL, NULL, NULL, Array) #3 /Applications/AMPPS/www/old.example.local/setup/includes/test/modinstalltest.class.php(305): modInstall->getConnection() #4 /Applications/AMPPS/www/old.example.local/setup/includes/test/modinstalltest.class.php(42): modInstallTest->_checkDatabase() #5 /Applications/AMPPS/www/old.example.local/setup/includes/modinstall.class.php(235): modInstallTest->run(NULL) #6 /Applications/AMPPS/www/old.example.local/setup/controllers/summary.php(16): modInstall->test(NULL) #7 / in /Applications/AMPPS/www/old.example.local/core/xpdo/xpdo.class.php on line 1867
                • 3749
                • 24,544 Posts
                That error message suggests a bad connection to the DB.



                  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
                  • 54187
                  • 16 Posts
                  Thanks Bob.

                  I found /core/config/config.inc.php had the remote db name, not the local db name.

                  I updated that file to use the local db name, and when I reach /setup/index.php?action=summary I receive a 500 internal server error.

                  When I visit /setup/index.php?action=database and enter the local db connection settings, I receive error:

                  Connecting to database server:
                  Could not connect to the database server. Check the connection properties and try again.

                  [2018-04-20 00:54:11] (ERROR in xPDOConnection::connect @ /Applications/AMPPS/www/old.example.local/core/xpdo/xpdo.class.php : 3043) SQLSTATE[HY000] [2019] Can't initialize character set (path: /Applications/AMPPS/mysql/share/charsets/)

                  [2018-04-20 00:54:11] (ERROR in xPDOConnection::connect @ /Applications/AMPPS/www/old.example.local/core/xpdo/xpdo.class.php : 3043) SQLSTATE[HY000] [2019] Can't initialize character set (path: /Applications/AMPPS/mysql/share/charsets/)

                  /core/config/config.inc.php contains the setting:
                  $database_connection_charset = 'utf8';

                  The front end displays error:

                  Fatal error: Uncaught Error: Call to a member function setProcessingElement() on null in /Applications/AMPPS/www/old.example.local/core/model/modx/modelement.class.php:265 Stack trace: #0 /Applications/AMPPS/www/old.example.local/core/model/modx/modtemplate.class.php(110): modElement->process(NULL, NULL) #1 /Applications/AMPPS/www/old.example.local/core/model/modx/modresource.class.php(446): modTemplate->process() #2 /Applications/AMPPS/www/old.example.local/core/model/modx/modresponse.class.php(75): modResource->process() #3 /Applications/AMPPS/www/old.example.local/core/model/modx/modrequest.class.php(145): modResponse->outputContent(Array) #4 /Applications/AMPPS/www/old.example.local/core/model/modx/modrequest.class.php(129): modRequest->prepareResponse() #5 /Applications/AMPPS/www/old.example.local/core/model/modx/modx.class.php(1404): modRequest->handleRequest() #6 /Applications/AMPPS/www/old.example.local/index.php(69): modX->handleRequest() #7 {main} thrown in /Applications/AMPPS/www/old.example.local/core/model/modx/modelement.class.php on line 265
                    • 3749
                    • 24,544 Posts
                    Make sure the DB credentials in the config file are for a database user who has full rights to the DB. Also, IIRC, the name of the database appears twice in the file -- make sure you fixed both.

                    It's a common mistake to use the MODX Manager credentials in the config file rather than the DB credentials for a DB user.

                      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