We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7527
    • 437 Posts
    Hi all,

    I am trying to link my old Revolution site up to a new web space. When I put in my web address I get the following message:

    Warning: require_once(/homepages/10/d568633693/htdocs/manager/includes/protect.inc.php): failed to open stream: No such file or directory in /homepages/10/d568633693/htdocs/index.php on line 52

    Fatal error: require_once(): Failed opening required '/homepages/10/d568633693/htdocs/manager/includes/protect.inc.php' (include_path='.:/usr/lib/php5.5') in /homepages/10/d568633693/htdocs/index.php on line 52

    And when I go to revolution.pawsforwildlife.co.uk/setup I get the same error (it has been set up as a subdomain)

    Any thoughts please?
    Regards,
    DS
      www.PawsForWildlife.co.uk
      www.Borntobrick.co.uk
      • 38783
      • 571 Posts
      Hello, Have you edited your configuration files to reflect the new path that your site is located on?
      core/config/config.inc.php
      /config.core.php
      /connectors/config.core.php
      /manager/config.core.php
      

      Details of the files that need to be edited and other things that you will need to do, like clearing the cache, are listed here:

      https://rtfm.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server
        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 47212
        • 40 Posts
        Personally, I was tired to edit this config file to move my sites between server environments. I update the config files in order to make MODX works anywhere.

        Here my core/config/config.inc.php file, you have to update the database values and replace the siteIds infos by yours and that's it. No need to take care of the paths.
        <?php
        /**
         *  MODX Configuration file
         */
        /*
         * My local machine
         */
        if ($_SERVER['SERVER_NAME'] === '192.168.0.27') {
        	$database_type 				 = 'mysql';
        	$database_server 			 = '192.168.0.27';
        	$port                        = '8889';
        	$database_user 				 = 'root';
        	$database_password 			 = 'root';
        	$database_connection_charset = 'utf8';
        	$dbase 						 = 'database_name';
        	$table_prefix 				 = 'modx_';
        }
        /*
         * My production machine
         */
        else {
        	$database_type 				 = 'mysql';
        	$database_server 			 = '000.000.0.000';
        	$port                        = '3306';
        	$database_user 				 = 'mysuperuser';
        	$database_password 			 = 'mysuperpassword';
        	$database_connection_charset = 'utf8';
        	$dbase 						 = 'database_name';
        	$table_prefix 				 = 'modx_';
        }
        
        $database_dsn = 'mysql:host=' . $database_server . ';port=' . $port . ';dbname=' . $dbase . ';charset=' . $database_connection_charset;
        $config_options = array (
        );
        $driver_options = array (
        );
        
        $lastInstallTime = 1446459582;
        
        /*
         * You have to put your site id infos here
        */
        $site_id = 'modx00000000000000';
        $site_sessionname = '0000000000';
        $https_port = '443';
        $uuid = '0000000000000000000';
        
        /*
         * No edit under this line ***************
         */
        if (!defined('MODX_CORE_PATH')) {
            $modx_core_path= dirname(dirname(__FILE__)) . '/';
            define('MODX_CORE_PATH', $modx_core_path);
        }
        if (!defined('MODX_PROCESSORS_PATH')) {
            $modx_processors_path= dirname(dirname(__FILE__)) . '/model/modx/processors/';
            define('MODX_PROCESSORS_PATH', $modx_processors_path);
        }
        if (!defined('MODX_CONNECTORS_PATH')) {
            $modx_connectors_path= dirname(dirname(dirname(__FILE__))) . '/connectors/';
            $modx_connectors_url= preg_replace('#'.$_SERVER['DOCUMENT_ROOT'].'#', '', dirname(dirname(dirname(__FILE__)))) . '/connectors/';
            define('MODX_CONNECTORS_PATH', $modx_connectors_path);
            define('MODX_CONNECTORS_URL', $modx_connectors_url);
        }
        if (!defined('MODX_MANAGER_PATH')) {
            $modx_manager_path= dirname(dirname(dirname(__FILE__))) . '/manager/';
            $modx_manager_url= preg_replace('#'.$_SERVER['DOCUMENT_ROOT'].'#', '', dirname(dirname(dirname(__FILE__)))) . '/manager/';
            define('MODX_MANAGER_PATH', $modx_manager_path);
            define('MODX_MANAGER_URL', $modx_manager_url);
        }
        if (!defined('MODX_BASE_PATH')) {
            $modx_base_path= dirname(dirname(dirname(__FILE__))) . '/';
            $modx_base_url= preg_replace('#'.$_SERVER['DOCUMENT_ROOT'].'#', '', dirname(dirname(dirname(__FILE__)))) . '/';
            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='ns3284084.ip-5-135-178.eu';
                define('MODX_HTTP_HOST', $http_host);
            } else {
                $http_host= array_key_exists('HTTP_HOST', $_SERVER) ? $_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= dirname(dirname(dirname(__FILE__))) . '/assets/';
            $modx_assets_url= preg_replace('#'.$_SERVER['DOCUMENT_ROOT'].'#', '', dirname(dirname(dirname(__FILE__)))) . '/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= false;
            define('MODX_CACHE_DISABLED', $modx_cache_disabled);
        }
        
        


        Then, you have to update this file :
        /config.core.php

        With this :
        <?php
        define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
        define('MODX_CONFIG_KEY', 'config');
        ?>
        


        And these :
        /connectors/config.core.php
        /manager/config.core.php

        With this :
        <?php
        define('MODX_CORE_PATH', dirname(dirname(__FILE__)) . '/core/');
        define('MODX_CONFIG_KEY', 'config');
        ?>
        


        I use this on my projects to only have to do a FTP transfer to publish from test environment to production.

        Always remove the "core/cache/" folder after moving your site. [ed. note: romainfallet last edited this post 8 years, 2 months ago.]
          • 7527
          • 437 Posts
          Thank you. When I closed down the site I literally unlinked it from the webspace, so I did not dump the MySQL database or clear cache, etc. Will that affect me trying this process, as it is stipulated in the link on the response from andytough?

          Regards,
          SB
            www.PawsForWildlife.co.uk
            www.Borntobrick.co.uk
            • 47212
            • 40 Posts
            Anyway, you can remove 'core/cache/' files safely, no data can be lost. And that will clear all cache files from anywhere. The system will recreate the cache depending on your new folder/installation.
            With that, you are certain that your problem does not come from the cache (if it remains), which can cause a lot of issues like this.

            For moving a site to another server or folder, you simply have to copy all your directory content at new location, edit the config files above with the new paths (to indicates to MODX where are its own file and to relink your MODX with the database) and remove the "core/cache/" folder content.

            If there is something you don't understand, feel free to ask.
              • 7527
              • 437 Posts
              Thanks, I have the following setup:

              pawsforwildlife/revolution/modx2/core

              I have opened that core folder and it is empty? I don't ever remember deleting anything from that folder

              Regards,

              DS
                www.PawsForWildlife.co.uk
                www.Borntobrick.co.uk
                • 13226
                • 953 Posts
                manager/includes/protect.inc.php

                This isn't referencing Revo - this is Evo

                Are you positive that the old install used Revolution and not Evolution - they are not compatible, so trying to install Revo over an Evo DB won't work [ed. note: iusemodx last edited this post 8 years, 2 months ago.]
                  • 7527
                  • 437 Posts
                  Sorry guys, I think I have got my wires crossed, iusemodx I think I have been looking at the wrong files. I will go back to the drawing board. Thanks for the help anyway
                    www.PawsForWildlife.co.uk
                    www.Borntobrick.co.uk