We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    I’m going to ask some dumb questions as I snoop through my webhosts forum’s...
    Questions that other people asked while they were trying to install and run various other applications and scripts.
    My asking the questions, doesn’t necessarily mean that I have any background to fully even understand the questions, clear as mud.
    I’m only asking these questions because it could relate to my ability to even run modXcms on my current host or others...

    First question: Do I need Register globals turned to on?
    If so they’ve suggested a code solution, I can paste those if the answer is YES I need globals on... whatever.
    As I say no clue what I’m really asking but yes’s and no’s are easy enough to understand fully, on this one.

    (The forum post from my webhost prompting the question:
    This issue comes up from time to time and may explain why certain PHP scripts won’t work correctly on our servers. As recommended by the PHP developers, and defaulted in current distributions, we have "register_globals=off" in our "php.ini" file (you can view the discussion at "www.php.net"). We know that there are scripts that depend on this setting being on.
    Thanks.

    As our Windows servers have only 1 shared "php.ini", it’s not possible to set this option for a single site. To make matters worse, the setting cannot be overridden via a call to "ini_set".
    )

    Second Dumb question already (wow... this could get ugly):
    Does modXCMS already have an include file built in that will show the actual error messages, or will I need to try implementing suck.

    (The forum post prompting the question:
    We have "display_errors" off in our "php.ini " file for security. As we are a Windows Host, our "php.ini" it is one one and only .ini file which translates into, we can’t turn it on for a particular site. )
    Pasting the code solution it’s a small snippet:
    <?php
    ini_set ("display_startup_errors", "1");
    ini_set ("display_errors", "1");
    ?> 
      • 25663 MODX Staff
      • 12,272 Posts
      Quote from: tzmedia at May 01, 2006, 09:21 AM

      First question: Do I need Register globals turned to on?
      Nope, not at all.

      As our Windows servers have only 1 shared "php.ini", it’s not possible to set this option for a single site. To make matters worse, the setting cannot be overridden via a call to "ini_set".

      Second Dumb question already (wow... this could get ugly):
      Does modXCMS already have an include file built in that will show the actual error messages, or will I need to try implementing suck.
      Not a dumb question, but I suspect that one might cause some problems. Don’t know for sure, but I’m definitely guessing it will depending on how the common shared ini file is set up.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 34162
        • 1 Posts
        Validated as a non-dumb question, that’s very encouraging.
        They further suggested pasting the code to show error messages into an include.
        Is there an existing page include that I could just add it too, and if so could you show me, where and how to add the code, with a code paste and the snippet included.
        Thanks.
        Code again:
        <?php
        ini_set ("display_startup_errors", "1");
        ini_set ("display_errors", "1");
        ?>
          • 33372
          • 1,611 Posts
          Looks to me as if your server is set up the way it should be for security reasons and MODx (well-written program that it is) will work fine with those settings. You can modify some ini values in your scripts themselves, including the error display level if you are having problems and need to debug them. If you have other questions feel free to ask them and the folks here will try to help (contrary to popular belief, there are dumb questions but I ask about half of them and they get answered, too).
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 34162
            • 1 Posts
            I guess it could be tacked onto the existing code then, I know I will want to see error messages at least in the beginning, there’s liable to be plenty of them.
            Not sure of the layout of the page template, and stuff, is there a common header file.
            I definately will need to get familiar with the layout structure of the generated page.
            I’m still stuck with a failed config.inc.php Can one be created and uploaded, that’s what a i saw as a workaround on a phpBB setup, it allows you to just download the page, if it won’t allow it to be written, and then uploaded.
            Remember your talking to a guy that has no idea what this file is or does, but I checked and it is a created file not one that exists beforehand.
              • 22303 MODX Staff
              • 10,725 Posts
              There are several options in the /index.php to turn on various error handling options (stopOnNotice for instance), and MODx uses a custom error handler already on platforms that do allow ini_set() calls.

              As for your config.inc.php file, just create a file with that name and put the normal PHP tags in it (these tags may not even be necessary, but...):

              <?php
              ?>


              As long as the webserver process can write to the file, everything should be fine.
                • 34162
                • 1 Posts
                It cannot write to the file, I think it’s in the process of creating the file is it not?
                Is there anyway to create this file, will this folder need write permissions for the long haul, if so I might be stuck.
                  • 33372
                  • 1,611 Posts
                  If the installer can’t write the file you can just create it in a text editor and upload it manually. It doesn’t need to be written to after that. In fact, you shouldn’t leave it as writeable once the install is finished.

                  Here is my config.inc.php file (with my server info edited). you can just cut and paste this into a text file and enter your details. Upload it and you’re all set.

                  <?php
                  	/**
                  	 *	MODx Configuration file
                  	 *
                  	 */
                  	$database_type = "mysql";
                  	$database_server = "localhost or databse ip address here";
                  	$database_user = "database_username";
                  	$database_password = "database_password";
                  	$dbase = "database_name";
                  	$table_prefix = "modx_";		
                  	error_reporting(E_ALL ^ E_NOTICE);
                  
                  	$site_sessionname = "SN444e9757e74c9";
                  	
                  	// 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')? 'http://' : 'https://';
                  		$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'];
                  		$site_url .= $base_url;
                  	}
                  
                  	// start cms session
                  	if(!function_exists('startCMSSession')) {
                  		function startCMSSession(){
                  			global $site_sessionname;
                  			session_name($site_sessionname);	
                  			session_start();
                  		}
                  	}
                  ?>


                  You might want to search these forums for general Windows server setup instructions (especially if you’re running IIS and not Apache)...
                    "Things are not what they appear to be; nor are they otherwise." - Buddha

                    "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                    Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                    • 34162
                    • 1 Posts
                    Cool Zap thanks, I was hoping the config file was just a temporary deal, I could even submit a ticket allowing it to be writeable, maybe that would be easiest... If I just dropped in a dummy file would the creation script installation setup maybe just overwrite it with the real one that would be cool, worth submitting the ticket, maybe I will try that.
                    Meanwhile I looked around a little for IIS instructions, but I got in the action mode finally and just went for it.
                    Thanks again everybody.
                      • 34162
                      • 1 Posts
                      Quick update, will it work?
                      I uploaded a blank file called config.inc.php...
                      And submitted a ticket to have write permissions for it...
                      I’m hoping the install program creates the entire page, will it?
                      Does it maybe only fill in the blanks between the " " quotations?
                      Anybody know how the config.inc.php file gets built... If this fails I’ll most likely need more details to fill in the blanks on my own build of the page.
                      Hoping my hack around will do the trick, waiting for the support ticket to get priority, probably be tomorrow, I think my support is only 8-5pm nowdays, that’s the way it goes though.
                      Any more advice on a php admin program I was recommended to go with:
                      PhpMyAdmin http://www.phpmyadmin.net as the easiest one, easy is good at least to get up and running.
                      thanks.