ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Config Overrides don't seem to be working

November 01, 2010 3:45pm

Subscribe [5]
  • #1 / Nov 01, 2010 3:45pm

    Chad Crowell

    242 posts

    I have a live site on 1.6.8 that works great.  I’m getting ready to do some updating to the site, so I downloaded all the files, created a staging. subdomain, then uploaded a copy of the files to that subdomain.  Both the live and staging sites will look at the current database.  All that is working - I can browse on both sites and all the resources loaded for pages are coming from the correct site.

    I added a bunch of config overrides to config.php so that the staging site looks to /staging/abcdef for templates rather than /www/abcdef.

    However, I am ready to begin editing templates and the edits won’t appear. The staging site is still looking to the /www/abcdef templates.

    Here are all my config values:

    $conf['app_version'] = "168";
    $conf['license_number'] = "abcdef";
    $conf['debug'] = "1";
    $conf['install_lock'] = "1";
    $conf['db_hostname'] = "localhost";
    $conf['db_username'] = "abcdef";
    $conf['db_password'] = "abcdef";
    $conf['db_name'] = "abcdef";
    $conf['db_type'] = "mysql";
    $conf['db_prefix'] = "exp";
    $conf['db_conntype'] = "0";
    $conf['system_folder'] = "abcdef";
    $conf['doc_url'] = "http://expressionengine.com/docs/";
    $conf['cookie_prefix'] = "";
    $conf['is_system_on'] = "y";
    $conf['allow_extensions'] = "y";
    $conf['multiple_sites_enabled'] = "n";
    $conf['cp_url'] = "http://staging.abcdef.com/admin.php";
    $conf['enable_online_user_tracking'] = "n";
    $conf['enable_hit_tracking'] = "n";
    $conf['enable_entry_view_tracking'] = "y";
    $conf['dynamic_tracking_disabling'] = "";
    $conf['user_module_key_expiration'] = "30";
    $conf['hidden_template_indicator'] = "_";
    $conf['user_email_is_username'] = "y";
    $conf['user_screen_name_override'] = "cf_member_fname|cf_member_lname";
    $conf['user_category_group'] = "2";
    
    $conf['site_index'] = '';
    $conf['site_url'] = 'http://staging.abcdef.org/';
    $conf['theme_folder_url'] = 'http://staging.abcdef.org/themes/';
    $conf['theme_folder_path'] = '/Users/webadmin/Sites/staging/themes/';
    $conf['tmpl_file_basepath'] = '/Users/webadmin/Sites/staging/abcdef/templates/';

    Any place I should be looking that I am not to get the staging site to reference this?

  • #2 / Nov 02, 2010 5:02am

    John Henry Donovan

    12339 posts

    Chad,

    When you look at your Template Preferences in your staging cp can you see the override basepath there?
    Any override you add in your config.php you will see it in the cp and not just the original one.

    Are your templates folder permissions correct?

  • #3 / Nov 02, 2010 12:48pm

    Chad Crowell

    242 posts

    Hi JH thanks for your help.

    I am not seeing the override there.  I see the www template path.

  • #4 / Nov 03, 2010 4:39am

    John Henry Donovan

    12339 posts

    Chad,

    Can you do a test for me? Can you quickly replicate that db locally and connect to it and see if the issue remains

  • #5 / Nov 04, 2010 8:02pm

    Chad Crowell

    242 posts

    Hi John Henry - finally got a local version of this working. 

    So, in my local version, by default it still shows the template path to the templates that exists in the database in the live site (as it should).  When I add

    $conf['tmpl_file_basepath'] = '/Users/Chad/repositories/domain/system/templates/';

    to the local config file and refresh the local CP template prefs page, it does show the above as the path, as it should.  Commenting that out and refreshing shows the database value again.  So, locally this is working.

  • #6 / Nov 05, 2010 10:48am

    Ingmar

    29245 posts

    You are saving your templates as files? As John Henry suggested, can you check file permissions there?

  • #7 / Nov 05, 2010 12:45pm

    Chad Crowell

    242 posts

    Yes, save templates as files is Yes, and the folder is writeable. I guess I could update to 1.7.0 and see if that fixes it.  I’m on 1.6.8.  Just weird that it works fine local and live but not staging.

  • #8 / Nov 06, 2010 3:05pm

    Greg Salt

    3988 posts

    Hi Chad,

    That is odd. Upgrading to 1.7.0 is a recommended update so if you can do that then check this again at least we’ll be working with the most recent files.

    Cheers

    Greg

  • #9 / Nov 07, 2010 2:22pm

    Chad Crowell

    242 posts

    I duplicated my db in order to run the 170 update on a test environment, and even with my staging site pointed at the new db, when I update the template basepath in the CP (or config.php) of the staging site, it changes the template basepath in the live site.  I am so lost I have no idea why any of this is happening.  The only thing I can think of is that there is some place where I define the site URL that I am missing, but everything is correct in config, etc.  I’ve done this 100 times and I don’t know why this is happening.

  • #10 / Nov 07, 2010 2:52pm

    Chad Crowell

    242 posts

    To add to this - in phpinfo for the staging site, its showing things like

    _SERVER[“DOCUMENT_ROOT”]  /Users/webadmin/Sites/www

    Shouldn’t the EE system in /staging/ look to the config.php file in its own system folder? 

    Could it be a server config issue that is not separating out the staging site from the www site?  This is on a colo mac mini server.

    Here is my full current staging config.php:

    <?php
    
    if ( ! defined('EXT')){
    exit('Invalid file request');
    }
    
    $conf['app_version'] = "168";
    $conf['license_number'] = "xxx";
    $conf['debug'] = "1";
    $conf['install_lock'] = "1";
    $conf['db_hostname'] = "localhost";
    $conf['db_username'] = "expression";
    $conf['db_password'] = "blah";
    $conf['db_name'] = "test_db";
    $conf['db_type'] = "mysql";
    $conf['db_prefix'] = "exp";
    $conf['db_conntype'] = "0";
    $conf['system_folder'] = "system";
    $conf['doc_url'] = "http://expressionengine.com/docs/";
    $conf['cookie_prefix'] = "";
    $conf['is_system_on'] = "y";
    $conf['allow_extensions'] = "y";
    $conf['multiple_sites_enabled'] = "n";
    $conf['cp_url'] = "http://staging.domain.org/admin.php";
    $conf['enable_online_user_tracking'] = "n";
    $conf['enable_hit_tracking'] = "n";
    $conf['enable_entry_view_tracking'] = "y";
    $conf['dynamic_tracking_disabling'] = "";
    $conf['user_module_key_expiration'] = "30";
    $conf['hidden_template_indicator'] = "_";
    $conf['user_email_is_username'] = "y";
    $conf['user_screen_name_override'] = "cf_member_fname|cf_member_lname";
    $conf['user_category_group'] = "2";
    
    $conf['admin_session_type'] = 's';
    $conf['site_index'] = '';
    $conf['site_name'] = 'Site Name';
    $conf['site_url'] = 'http://staging.domain.org/';
    $conf['theme_folder_url'] = 'http://staging.domain.org/themes/';
    $conf['theme_folder_path'] = '/Users/webadmin/Sites/staging/themes/';
    $conf['tmpl_file_basepath'] = '/Users/webadmin/Sites/staging/system/templates/';
    
    ?>

    and for the www site:

    <?php
    
    if ( ! defined('EXT')){
    exit('Invalid file request');
    }
    
    $conf['app_version'] = "168";
    $conf['license_number'] = "xxx";
    $conf['debug'] = "1";
    $conf['install_lock'] = "1";
    $conf['db_hostname'] = "localhost";
    $conf['db_username'] = "expression";
    $conf['db_password'] = "blah";
    $conf['db_name'] = "expression_engine";
    $conf['db_type'] = "mysql";
    $conf['db_prefix'] = "exp";
    $conf['db_conntype'] = "0";
    $conf['system_folder'] = "system";
    $conf['doc_url'] = "http://expressionengine.com/docs/";
    $conf['cookie_prefix'] = "";
    $conf['is_system_on'] = "y";
    $conf['allow_extensions'] = "y";
    $conf['multiple_sites_enabled'] = "n";
    $conf['cp_url'] = "http://staging.domain.org/admin.php";
    $conf['enable_online_user_tracking'] = "n";
    $conf['enable_hit_tracking'] = "n";
    $conf['enable_entry_view_tracking'] = "y";
    $conf['dynamic_tracking_disabling'] = "";
    $conf['user_module_key_expiration'] = "30";
    $conf['hidden_template_indicator'] = "_";
    $conf['user_email_is_username'] = "y";
    $conf['user_screen_name_override'] = "cf_member_fname|cf_member_lname";
    $conf['user_category_group'] = "2";
    ?>
  • #11 / Nov 08, 2010 10:25am

    Sue Crocker

    26054 posts

    About the only thing I’m seeing that *may* be an issue is the length of the staging server’s path. I found a 2.x post about needing to change the value to something larger..

    http://ellislab.com/forums/viewthread/163708/

  • #12 / Nov 08, 2010 1:35pm

    Chad Crowell

    242 posts

    Great find Sue, however, I shortened the template basepath in the staging config and it still didn’t show up in the staging CP.

    I think I’ll delete the site and redeploy it at this point.  Maybe some voodoo is happening.

  • #13 / Nov 08, 2010 5:30pm

    Ingmar

    29245 posts

    Sounds like a plan. Just keep us in the loop, please.

  • #14 / Nov 09, 2010 4:19am

    Chad Crowell

    242 posts

    Never could figure this out.  *Has* to be a server config issue.  I moved the staging site to my Encaf dev server and its working fine.  Thanks guys!

  • #15 / Nov 09, 2010 3:46pm

    Ingmar

    29245 posts

    So, you’re good, i.e. up and running?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases