We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15871
    • 105 Posts
    I am waiting to hear from Network Solutions. Hopefully I’ll have a solution today.
      • 8619
      • 229 Posts
      I assume that there is nothing that I can reconfigure in the config.inc.php file that would override this and define the base_url myself to avoid this issue in the future?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Yes, you can simply comment out the whole block of code that calculates the $base_url, $site_url, and $base_path and hard-code the values.

        I have been thinking that it might be better to have those values calculated at install time and verified by the installer, then written to the database or the config file. This auto-configuration seems to be having problems lately.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 8619
          • 229 Posts
          Susan,

          Thanks for the reply....I’m not that familiar with the inner workings of MODx or config.inc.php, would you be willing to help me out there?

          Thanks!
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Sure. Starting with line 16 in your manager/includes/config.inc.php file, comment out this block:
            	// automatically assign base_path and base_url
            /*	if($base_path==""||$base_url=="") {
            		$a = explode("/manager",str_replace("\\","/",dirname($_SERVER["PHP_SELF"])));
            		if(count($a)>1) array_pop($a);
            		$url = implode("manager",$a); reset($a);
            		$a = explode("manager",str_replace("\\","/",dirname(__FILE__)));
            		if(count($a)>1) array_pop($a);
            		$pth = implode("manager",$a); unset($a);
            		$base_url = $url.(substr($url,-1)!="/"? "/":"");
            		$base_path = $pth.(substr($pth,-1)!="/" && substr($pth,-1)!="\\"? "/":"");
            		$site_url = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on') || $_SERVER['SERVER_PORT']==$https_port)? 'https://' : 'http://';
            		$site_url .= $_SERVER['HTTP_HOST'];
            		if($_SERVER['SERVER_PORT']!=80) $site_url = str_replace(':'.$_SERVER['SERVER_PORT'],'',$site_url); // remove port from HTTP_HOST 
            		$site_url .= ($_SERVER['SERVER_PORT']==80 || (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on') || $_SERVER['SERVER_PORT']==$https_port)? '':':'.$_SERVER['SERVER_PORT'];
            		$site_url .= $base_url;
            	}  */
            

            Now add three lines,
            $base_url = '/';
            $site_url = 'http://www.mysite.com/';
            $base_path='/home/mysite/public_html/';
            

            just before the three "if (!defined(...)) define..." lines.

            Somebody who has a better idea of what these values should be, please correct me on this.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 23491 ☆ A M B ☆
              • 1,056 Posts
              Another possible approach could be to replace the problematic "goofy items" with empty space, slashes, etc. However, hard-coding would be much less processor intensive.

              Or, you could attempt this method UNTIL you get it working, then simply hard-code the values (a better solution) smiley Good luck in the meantime.
              The BEST solution would be to modify the server configuration to its previous working state, if possible.
                Mike Reid - www.pixelchutes.com
                MODx Ambassador / Contributor
                [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                ________________________________
                Where every pixel matters.
                • 25663 MODX Staff
                • 12,272 Posts
                I’m very interested in seeing what the cause of the problem is so that we can perhaps code around it for a future release.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I have one server where the $_SERVER variables are reporting the location of the actual PHP runtime, I forget the exact value, but it had to be hard-coded. Naturally, I can’t find it now; I’ve been working with too many different sites lately.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 8619
                    • 229 Posts
                    Ok, it’s not liking the:

                    $base_path = ’/home/unionky911/public_html/’;

                    Not sure where that is supposed to be pointing to....any ideas?
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Dunno, that’s what mine evaluates to (more or less...)
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org