We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3093
    • 45 Posts
    Hello all,
    I hope you can help me figure this out. I'm afraid I've hit a brick wall.
    I am transferring MODX 2.0.0 to a new server, in a subfolder this time, but I will point to it with an add-on domain. I followed all the instructions carefully, but still got errors.

    The first error in the logs is this one:

    PHP Fatal error: Class 'modValidator' not found in /home/mashkioya/public_html/splitrailgolf/core/xpdo/om/xpdoobject.class.php on line 1780, referer: http://benjaminbruce.com/splitrailgolf/manager/

    Then at the bottom of various pages and the manager login, I see one of these two errors:

    PHP Fatal error: Undefined class constant 'LOG_LEVEL_ERROR' in /home/mashkioya/public_html/splitrailgolf/core/model/modx/error/moderrorhandler.class.php on line 82

    PHP Fatal error: Class 'xPDOCacheManager' not found in /home/mashkioya/public_html/splitrailgolf/core/model/modx/modx.class.php on line 2783

    I packaged all the files up in a GZIP archive to move them over, so I don't think files missing or corrupted is the problem. The permissions seem to be OK. It's possible that I've set up my config.inc.php wrong, so I've attached that for your perusal.

    I haven't re-run setup yet, but when I tried all this yesterday that didn't solve the problem. Neither have I pointed my add-on domain to this folder yet, so I'm still accessing it through the subfolder. But these errors don't seem to have anything to do with that.

    Anyone have any ideas? Thanks in advance for your help.
      • 3093
      • 45 Posts
      I can't seem to attach the config file, so here it is:

      <?php
      /**
       *  MODx Configuration file
       */
      $database_type = 'mysql';
      $database_server = 'localhost';
      $database_user = 'dbuser';
      $database_password = '*********';
      $database_connection_charset = 'utf8';
      $dbase = '`dbname`';
      $table_prefix = 'modx_';      
      
      $lastInstallTime = 1281142060;
      
      // I've tried the URLs below with and without the subfolder name.
      
      $site_id = 'modx4c5cad2cd2fe93.60130008';
      $site_sessionname = 'SN4c5caa4c03b1d';
      $https_port = '443';
      
      if (!defined('MODX_CORE_PATH')) {
          $modx_core_path= '/home/mashkioya/public_html/splitrailgolf/core/';
          define('MODX_CORE_PATH', $modx_core_path);
      }
      if (!defined('MODX_PROCESSORS_PATH')) {
          $modx_processors_path= '/home/mashkioya/public_html/splitrailgolf/core/model/modx/processors/';
          define('MODX_PROCESSORS_PATH', $modx_processors_path);
      }
      if (!defined('MODX_CONNECTORS_PATH')) {
          $modx_connectors_path= '/home/mashkioya/public_html/splitrailgolf/connectors/';
          $modx_connectors_url= '/splitrailgolf/connectors/';
          define('MODX_CONNECTORS_PATH', $modx_connectors_path);
          define('MODX_CONNECTORS_URL', $modx_connectors_url);
      }
      if (!defined('MODX_MANAGER_PATH')) {
          $modx_manager_path= '/home/mashkioya/public_html/splitrailgolf/manager/';
          $modx_manager_url= '/splitrailgolf/manager/';
          define('MODX_MANAGER_PATH', $modx_manager_path);
          define('MODX_MANAGER_URL', $modx_manager_url);
      }
      if (!defined('MODX_BASE_PATH')) {
          $modx_base_path= '/home/mashkioya/public_html/splitrailgolf/';
          $modx_base_url= '/splitrailgolf/';
          define('MODX_BASE_PATH', $modx_base_path);
          define('MODX_BASE_URL', $modx_base_url);
      }
      if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
      	$isSecureRequest = false;
      } else {
      	$isSecureRequest = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
      }
      if (!defined('MODX_URL_SCHEME')) {
          $url_scheme=  $isSecureRequest ? 'https://' : 'http://';
          define('MODX_URL_SCHEME', $url_scheme);
      }
      
      // I've tried the $http_host below both with the original domain splitrailgolf.com and the new host benjaminbruce.com
      if (!defined('MODX_HTTP_HOST')) {
      	if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
      		$http_host='benjaminbruce.com';
      		define('MODX_HTTP_HOST', $http_host);
      	} else {
      		$http_host= $_SERVER['HTTP_HOST'];
      		if ($_SERVER['SERVER_PORT'] != 80) {
      			$http_host= str_replace(':' . $_SERVER['SERVER_PORT'], '', $http_host); // remove port from HTTP_HOST
      		}
      		$http_host .= ($_SERVER['SERVER_PORT'] == 80 || $isSecureRequest) ? '' : ':' . $_SERVER['SERVER_PORT'];
      		define('MODX_HTTP_HOST', $http_host);
      	}
      }
      if (!defined('MODX_SITE_URL')) {
          $site_url= $url_scheme . $http_host . MODX_BASE_URL;
          define('MODX_SITE_URL', $site_url);
      }
      if (!defined('MODX_ASSETS_PATH')) {
          $modx_assets_path= '/home/mashkioya/public_html/splitrailgolf/assets/';
          $modx_assets_url= '/splitrailgolf/assets/';
          define('MODX_ASSETS_PATH', $modx_assets_path);
          define('MODX_ASSETS_URL', $modx_assets_url);
      }
      if (!defined('MODX_LOG_LEVEL_FATAL')) {
          define('MODX_LOG_LEVEL_FATAL', 0);
          define('MODX_LOG_LEVEL_ERROR', 1);
          define('MODX_LOG_LEVEL_WARN', 2);
          define('MODX_LOG_LEVEL_INFO', 3);
          define('MODX_LOG_LEVEL_DEBUG', 4);
      }
      if (!defined('MODX_CACHE_DISABLED')) {
          $modx_cache_disabled= true;
          define('MODX_CACHE_DISABLED', $modx_cache_disabled);
      }
        • 3749
        • 24,544 Posts
        Try deleting all the files in the core/cache directory, running Setup, and then visiting the site using incognito or private mode in your browser.

        If it still doesn't work, check the three config.core.php files (in the MODX root, manager, and connectors directories).
          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
          • 3093
          • 45 Posts
          I went through those steps, but that didn't seem to make any difference.

          Question: What should the three config.core.php files look like inside for MODX 2.0.0? The transfer instructions tell me that I should put in the full path to the core directory, but what was there was dirname(__FILE__) concatenated with "/core/".

          I replaced that with the full path in each config.core.php file, but now the site is giving me 503 Site Unavailable.
          • What is in .htaccess?

            You'll want to add the sub directory to the rewrite base

            RewriteBase /yourSubDirectory


            Insofar as the three config files, the full path should be there.
            config.core.php example with your paths as seen above:
            <?php
            define('MODX_CORE_PATH', '/home/mashkioya/public_html/splitrailgolf/core/');
            define('MODX_CONFIG_KEY', 'config');
            ?>


            Did you download a new MODX-your-version.zip file to run setup with, or did you use existing unpacked files? Even if you did, try a new download, unpack on the server (don't use FTP to upload locally unpacked files, it's unreliable) and re-run setup after changing any of the config paths. Make sure to clear the core/cache folder before running setup.
              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster