We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20413
    • 2,877 Posts
    Did you try the other option? smiley

    Forum tip!
    After pasting in code in the forums, select it
    (so it’s higlighted) and click the code button.
    Looks like this ---> []


      @hawproductions | http://mrhaw.com/

      Infograph: MODX Advanced Install in 7 steps:
      http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

      Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
      http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
      • 28956
      • 73 Posts
      Thanks for the coding suggestion...I will use that the next time I post codes on here...

      But I must say that I didn’t understand the other tip...

      I didn’t see any of the collation information in the system resources, and I didn’t know why I needed to edit a php file to find this information.

      And the config.inc.php file didn’t seem to have the info, either...

      And do you know about the database table name and number of fields, as well?
        • 3749
        • 24,544 Posts
        Did you scroll all the way to the top of your config.inc.php file? There should be a section just above what you posted with the charset, db name, password, etc.

        Be sure not to post the actual username and password here.
          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
          • 28956
          • 73 Posts
          Sure...here’s what it says:

          $database_type = 'mysql';
          $database_server = 'p50mysql181.secureserver.net';
          $database_user = **deleted**
          $database_password = **deleted;
          $database_connection_charset = '';
          $dbase = '`hopeagain`';
          $table_prefix = 'modx_';
          error_reporting(E_ALL & ~E_NOTICE);
            • 20413
            • 2,877 Posts
            Quote from: suttles95 at Jan 26, 2010, 11:07 PM

            I didn’t see any of the collation information in the system resources, and I didn’t know why I needed to edit a php file to find this information.

            Then log into your LIVE sites phpMyAdmin and select the MODx db.
            Now you’ll see something like this: http://radified.com/_gfx/02/utf8_phpmyadmin.png

            if Collation is utf8_general_ci Your encoding is UTF-8 and your collation utf8_general_ci
              @hawproductions | http://mrhaw.com/

              Infograph: MODX Advanced Install in 7 steps:
              http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

              Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
              http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
              • 28956
              • 73 Posts
              Bingo!!


              Now do I need to create a database table before I import my site’s database What do I put for number of fields?
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                You do not need to create any tables. Importing the backup .sql file will create the necessary tables.
                  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
                  • 28956
                  • 73 Posts
                  Okay, I created a database in mampp and imported my website’s DB into it.

                  I then went into the mamp/htdocs/hopeagaintesting folder and edited the config.inc.php in the /includes folder to the following:

                  <?php
                  /**
                   *	MODx Configuration file
                   */
                  $database_type = 'mysql';
                  $database_server = 'localhost';
                  $database_user = 'root';
                  $database_password = '**There is a password here.  Does there need to be?**';
                  $database_connection_charset = '';
                  $dbase = '`hopeagain`';
                  $table_prefix = 'modx_';
                  error_reporting(E_ALL & ~E_NOTICE);
                  
                  $lastInstallTime = 1213017546;
                  
                  $site_sessionname = 'SN484d2dc9d8c89';
                  $https_port = '443';
                  
                  // automatically assign base_path and base_url
                  if(empty($base_path)||empty($base_url)||$_REQUEST['base_path']||$_REQUEST['base_url']) {
                      $sapi= 'undefined';
                      if (!strstr($_SERVER['PHP_SELF'], $_SERVER['SCRIPT_NAME']) && ($sapi= @ php_sapi_name()) == 'cgi') {
                          $script_name= $_SERVER['PHP_SELF'];
                      } else {
                          $script_name= $_SERVER['SCRIPT_NAME'];
                      }
                      $a= explode("/manager", str_replace("\\", "/", dirname($script_name)));
                      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) != "\\" ? "/" : "");
                      // assign site_url
                      $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;
                  }
                  
                  if (!defined('MODX_BASE_PATH')) define('MODX_BASE_PATH', $base_path);
                  if (!defined('MODX_BASE_URL')) define('MODX_BASE_URL', $base_url);
                  if (!defined('MODX_SITE_URL')) define('MODX_SITE_URL', $site_url);
                  if (!defined('MODX_MANAGER_PATH')) define('MODX_MANAGER_PATH', $base_path.'manager/');
                  if (!defined('MODX_MANAGER_URL')) define('MODX_MANAGER_URL', $site_url.'manager/');
                  
                  // start cms session
                  if(!function_exists('startCMSSession')) {
                  	function startCMSSession(){
                  		global $site_sessionname;
                  		session_name($site_sessionname);
                  		session_start();
                  		$cookieExpiration= 0;
                          if (isset ($_SESSION['mgrValidated']) || isset ($_SESSION['webValidated'])) {
                              $contextKey= isset ($_SESSION['mgrValidated']) ? 'mgr' : 'web';
                              if (isset ($_SESSION['modx.' . $contextKey . '.session.cookie.lifetime']) && is_numeric($_SESSION['modx.' . $contextKey . '.session.cookie.lifetime'])) {
                                  $cookieLifetime= intval($_SESSION['modx.' . $contextKey . '.session.cookie.lifetime']);
                              }
                              if ($cookieLifetime) {
                                  $cookieExpiration= time() + $cookieLifetime;
                              }
                  			if (!isset($_SESSION['modx.session.created.time'])) {
                  			  $_SESSION['modx.session.created.time'] = time();
                  			}
                          }
                  		setcookie(session_name(), session_id(), $cookieExpiration, MODX_BASE_URL);
                  	}
                  }
                  ?>


                  Per instructions, I changed the ports to 80 and 3306.

                  But when I click on "Open Page," it takes me to the "Welcome to Mamp" welcome page instead of my site.

                  What have I done wrong?
                    • 20413
                    • 2,877 Posts
                    Use
                    $database_password = 'root';


                    What if you use default port settings
                    http://localhost:8888/hopeagaintesting

                    (I’ve NEVER used mamp and haven’t worked with a mac in years)
                      @hawproductions | http://mrhaw.com/

                      Infograph: MODX Advanced Install in 7 steps:
                      http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                      Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                      http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                      • 28956
                      • 73 Posts
                      Okay, I changed the database_password to ’root’, and now the config file contains:

                      <?php
                      /**
                       *	MODx Configuration file
                       */
                      $database_type = 'mysql';
                      $database_server = 'localhost';
                      $database_user = 'root';
                      $database_password = 'root';
                      $database_connection_charset = '';
                      $dbase = '`hopeagain`';
                      $table_prefix = 'modx_';
                      error_reporting(E_ALL & ~E_NOTICE);
                      
                      $lastInstallTime = 1213017546;
                      
                      $site_sessionname = 'SN484d2dc9d8c89';
                      $https_port = '443';
                      
                      // automatically assign base_path and base_url
                      if(empty($base_path)||empty($base_url)||$_REQUEST['base_path']||$_REQUEST['base_url']) {
                          $sapi= 'undefined';
                          if (!strstr($_SERVER['PHP_SELF'], $_SERVER['SCRIPT_NAME']) && ($sapi= @ php_sapi_name()) == 'cgi') {
                              $script_name= $_SERVER['PHP_SELF'];
                          } else {
                              $script_name= $_SERVER['SCRIPT_NAME'];
                          }
                          $a= explode("/manager", str_replace("\\", "/", dirname($script_name)));
                          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) != "\\" ? "/" : "");
                          // assign site_url
                          $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;
                      }
                      
                      if (!defined('MODX_BASE_PATH')) define('MODX_BASE_PATH', $base_path);
                      if (!defined('MODX_BASE_URL')) define('MODX_BASE_URL', $base_url);
                      if (!defined('MODX_SITE_URL')) define('MODX_SITE_URL', $site_url);
                      if (!defined('MODX_MANAGER_PATH')) define('MODX_MANAGER_PATH', $base_path.'manager/');
                      if (!defined('MODX_MANAGER_URL')) define('MODX_MANAGER_URL', $site_url.'manager/');
                      
                      // start cms session
                      if(!function_exists('startCMSSession')) {
                      	function startCMSSession(){
                      		global $site_sessionname;
                      		session_name($site_sessionname);
                      		session_start();
                      		$cookieExpiration= 0;
                              if (isset ($_SESSION['mgrValidated']) || isset ($_SESSION['webValidated'])) {
                                  $contextKey= isset ($_SESSION['mgrValidated']) ? 'mgr' : 'web';
                                  if (isset ($_SESSION['modx.' . $contextKey . '.session.cookie.lifetime']) && is_numeric($_SESSION['modx.' . $contextKey . '.session.cookie.lifetime'])) {
                                      $cookieLifetime= intval($_SESSION['modx.' . $contextKey . '.session.cookie.lifetime']);
                                  }
                                  if ($cookieLifetime) {
                                      $cookieExpiration= time() + $cookieLifetime;
                                  }
                      			if (!isset($_SESSION['modx.session.created.time'])) {
                      			  $_SESSION['modx.session.created.time'] = time();
                      			}
                              }
                      		setcookie(session_name(), session_id(), $cookieExpiration, MODX_BASE_URL);
                      	}
                      }
                      ?>


                      I also changed the ports back to 8888 and 8889.

                      But when I click on http://localhost:8888/hopeagaintesting, I get an error page that says:

                      Un authorized access
                      You’re not allowed to access file folder.