We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40649
    • 40 Posts
    I set the site up on a temporary url when I moved it to a new server. I've changed the nameservers and the site is now live. Now, I'm finding that when I hit "view site" it's showing the old url and that page, vs. the new url that the site is now live on. Can anyone help me change this setting? I can't seem to find where it's pulling it from. Thanks in advance! smiley
      • 22840
      • 1,572 Posts
      you need to update the main configuration file in core/config/config.inc.php and you'll also wan't to delete the cache files

      http://rtfm.modx.com/display/revolution20/Moving+Your+Site+to+a+New+Server
        • 40649
        • 40 Posts
        Hi- thanks for your response! I tried to modify the php according to the URL you sent. I can now log in to the manager, but it's just a bunch of links that when you click them go nowhere. I am totally lost on this and have attached a screenshot of the php so you can see what I may have missed/done wrong. The URL of my website is supposed to be www.ammoniagauge.com. The document root path is correct and the ~demarc6/ is (I believe) from the temporary URL I set the site up on before sending it live. I've pointed the nameservers from the old host, but still can't see the site. Any help is so appreciated as I've minimal experience with php and modx.
          • 22840
          • 1,572 Posts
          That document appears to be a blank word document so I can't see anything, can you post what you have in core/config/config.inc.php in relation to the below, and there shouldn't be any ~demarc6/ in there now it's moved to the live url, should just be /


          $modx_core_path= '/path/to/modx_doc_root/core/';
          $modx_processors_path= '/path/to/modx_doc_root/core/model/modx/processors/';
          $modx_connectors_path= '/path/to/modx_doc_root/connectors/';
          $modx_manager_path= '/path/to/modx_doc_root/manager/';
          $modx_base_path= '/path/to/modx_doc_root/';
          $modx_assets_path= '/path/to/modx_doc_root/assets/';
           
          /* HOST (used for command-line PHP stuff) */
          $http_host='yoursite.com';
            • 40649
            • 40 Posts
            So kind of you to respond-- here it is and sorry for the blank doc....

                $modx_core_path= '/home/demarc6/public_html/ammoniagauge/modx/core/';
                define('MODX_CORE_PATH', $modx_core_path);
            }
            if (!defined('MODX_PROCESSORS_PATH')) {
                $modx_processors_path= '/home/demarc6/public_html/ammoniagauge/modx/core/model/modx/processors/';
                define('MODX_PROCESSORS_PATH', $modx_processors_path);
            }
            if (!defined('MODX_CONNECTORS_PATH')) {
                $modx_connectors_path= '/home/demarc6/public_html/ammoniagauge/modx/connectors/';
                $modx_connectors_url= '/ammoniagauge.com/modx/connectors/';
                define('MODX_CONNECTORS_PATH', $modx_connectors_path);
                define('MODX_CONNECTORS_URL', $modx_connectors_url);
            }
            if (!defined('MODX_MANAGER_PATH')) {
                $modx_manager_path= '/home/demarc6/public_html/ammoniagauge/modx/manager/';
                $modx_manager_url= '/ammoniagauge.com/modx/manager/';
                define('MODX_MANAGER_PATH', $modx_manager_path);
                define('MODX_MANAGER_URL', $modx_manager_url);
            }
            if (!defined('MODX_BASE_PATH')) {
                $modx_base_path= '/home/demarc6/public_html/ammoniagauge/modx/';
                $modx_base_url= '/ammoniagauge.com/modx/';
                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);
            }
            if (!defined('MODX_HTTP_HOST')) {
                if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
                    $http_host='ammoniagauge.com';
              • 22840
              • 1,572 Posts
              Ok did you do a traditional install or did you move the manager folder ?
                • 22840
                • 1,572 Posts
                If installed the normal way try this:

                $modx_core_path= '/home/demarc6/public_html/core/';
                    define('MODX_CORE_PATH', $modx_core_path);
                }
                if (!defined('MODX_PROCESSORS_PATH')) {
                    $modx_processors_path= '/home/demarc6/public_html/core/model/modx/processors/';
                    define('MODX_PROCESSORS_PATH', $modx_processors_path);
                }
                if (!defined('MODX_CONNECTORS_PATH')) {
                    $modx_connectors_path= '/home/demarc6/public_html/connectors/';
                    $modx_connectors_url= '/connectors/';
                    define('MODX_CONNECTORS_PATH', $modx_connectors_path);
                    define('MODX_CONNECTORS_URL', $modx_connectors_url);
                }
                if (!defined('MODX_MANAGER_PATH')) {
                    $modx_manager_path= '/home/demarc6/public_html/manager/';
                    $modx_manager_url= '/manager/';
                    define('MODX_MANAGER_PATH', $modx_manager_path);
                    define('MODX_MANAGER_URL', $modx_manager_url);
                }
                if (!defined('MODX_BASE_PATH')) {
                    $modx_base_path= '/home/demarc6/public_html/';
                    $modx_base_url= '/';
                    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 ? '<a href="https://%27" target="_blank" rel="nofollow">https://'</a>
                 : '<a href="http://%27;" target="_blank" rel="nofollow">http://';</a>
                 
                    define('MODX_URL_SCHEME', $url_scheme);
                }
                if (!defined('MODX_HTTP_HOST')) {
                    if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
                        $http_host='www.ammoniagauge.com';
                 


                Also around lines 77 - 82 should be reference to your assets path, they need to be:

                if (!defined('MODX_ASSETS_PATH')) {
                    $modx_assets_path= '/home/demarc6/public_html/assets/';
                    $modx_assets_url= '/assets/';
                    define('MODX_ASSETS_PATH', $modx_assets_path);
                    define('MODX_ASSETS_URL', $modx_assets_url);
                }


                Backup the file before using this and once you have empty the cache folder and see if everything is working again.
                  • 40649
                  • 40 Posts
                  Hi-- I uploaded it all myself- long story. I just realized that I have two modx files in my file manager. I want to delete one, but can't tell where I'm modifying from/what's affecting the site. There is one at demarc6/modx and one at public_html/ammoniagauge/modx. I also have an assets file (at ammoniagauge/assets) outside of the modx file where I put all of my templates, images, etc. Inside of the ammoniagauge/modx/assets file there is nothing. Where should all of this be, so I can re-organize? Once I do that, all of your filepaths above will work out, I think, but I want to make sure I'm not moving/deleting something I shouldn't. Thanks for your help thus far! smiley
                    • 3749
                    • 24,544 Posts
                    Any MODX stuff in the demarc6/ directory is not reachable by URL and doing nothing there. I doubt if it's causing any trouble, so I'd leave it there for now.

                    It looks like you have an install at demarc6/public_html. You should have assets, core, manager, connectors, and setup directories there.

                    If that's the case, the config file PaulP posted would be correct, except that the Forum software has mangled the hrefs toward the end (which you probably don't need to change).

                    My guess is that MODX is finding your core directory, because the path is correct in the config.core.php file(s), but it's not finding other things because the ones in config.inc.php are not correct.

                    Double-check the three config.core.php files to make sure they all have the same path and that it's correct (probably home/demarc6/public_html/). Here are their locations:


                    § MODX root directory
                    § /manager/
                    § /connectors/



                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.html [ed. note: BobRay last edited this post 14 years, 2 months ago.]
                      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
                      • 40649
                      • 40 Posts
                      Thanks BobRay. smiley All the modx core.config.php files have the same path for the modx/core file and it seems to be the correct filepath. My file path starts with home/demarc6/public_html/ammoniagauge/modx. This is the correct path in my file manager, but does modx have an issue with the extra folders?

                      Here is my config file now:
                      if (!defined('MODX_CORE_PATH')) {
                          $modx_core_path= '/home/demarc6/public_html/ammoniagauge/modx/core/';
                          define('MODX_CORE_PATH', $modx_core_path);
                      }
                      if (!defined('MODX_PROCESSORS_PATH')) {
                          $modx_processors_path= '/home/demarc6/public_html/ammoniagauge/modx/core/model/modx/processors/';
                          define('MODX_PROCESSORS_PATH', $modx_processors_path);
                      }
                      if (!defined('MODX_CONNECTORS_PATH')) {
                          $modx_connectors_path= '/home/demarc6/public_html/ammoniagauge/modx/connectors/';
                          $modx_connectors_url= '/ammoniagauge/modx/connectors/';
                          define('MODX_CONNECTORS_PATH', $modx_connectors_path);
                          define('MODX_CONNECTORS_URL', $modx_connectors_url);
                      }
                      if (!defined('MODX_MANAGER_PATH')) {
                          $modx_manager_path= '/home/demarc6/public_html/ammoniagauge/modx/manager';
                          $modx_manager_url= '/ammoniagauge/modx/manager/';
                          define('MODX_MANAGER_PATH', $modx_manager_path);
                          define('MODX_MANAGER_URL', $modx_manager_url);
                      }
                      if (!defined('MODX_BASE_PATH')) {
                          $modx_base_path= '/home/demarc6/public_html/ammoniagauge/modx/';
                          $modx_base_url= '/';
                          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);
                      }
                      if (!defined('MODX_HTTP_HOST')) {
                          if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
                              $http_host='www.ammoniagauge.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/demarc6/public_html/ammoniagauge/modx/assets/';
                          $modx_assets_url= '/ammoniagauge/modx/assets/';
                          define('MODX_ASSETS_PATH', $modx_assets_path);
                          define('MODX_ASSETS_URL', $modx_assets_url);
                      }


                      I've attached a pdf screenshot of my cpanel file manager to this reply, so you can see what's going on.

                      With all of this info, I'm receiving this error message at ammoniagauge.com/modx/manager

                      Fatal error: Call to a member function setNamespace() on a non-object in /home/demarc6/public_html/ammoniagauge/modx/core/model/modx/moddashboardwidget.class.php on line 104

                      At line 103-105 in that file, this is what I see:

                       if (!empty($namespace)) {
                                  $widget->setNamespace($namespace);
                              }
                      


                      Can you help me sort all of this out? I would appreciate it-- I've been working on it for hours and have a feeling it's something an experience person would see right away. smiley I'm just sick about this all being so messed up and am really anxious to find a solution.

                      Thanks!