Jump to:

22979 Posts in 11815 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » 2 sites - config.php database settings ignored - dev/build still loads

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 264 Views
  • acktivate
    Avatar
    Community Member
    10 Posts

    2 sites - config.php database settings ignored - dev/build still loads Link to this post

    I am running two sites on 3.0.5 and using symbolic links. The dev site database settings are ignored in mysite/_config.php and uses the production database settings. I know this because when I ran a dev/build on the dev site, the page loaded with no errors but displayed the production database name at the top.

    www.domain.com and dev.domain.com

    In the mysite/_config.php,

    each site has a unique username, database name and password.

    www.domain.com
    un: prod_db_admin
    db name: prod_db
    pw: ***

    dev.domain.com
    un: dev_db_admin
    db name: dev_db
    pw: ***

    I added 2 new PHP files mysite/code on dev.domain.com and I ran dev/build on dev.domain.com, the page loaded with no errors and the message at the top says "Building database prod_db using MySQL 5.1.56-log."

    I logged into www.domain.com/admin/ and added a page to the CMS and then logged into dev.domain.com/admin/ and the new page appears there as well.

    The 2 new PHP files do not exist on mysite/code on www.domain.com yet when I review the dev/build results from the prod_db, the new tables are listed that were created by the 2 new PHP files from the dev site.

    I deleted the silverstripe-cache folders on both sites and recreated.

    thoughts?

  • Bambii7
    Avatar
    Community Member
    254 Posts

    Re: 2 sites - config.php database settings ignored - dev/build still loads Link to this post

    Hi acktivate,

    I don't quite understand the set up. Do you have a dev and prod site symbolically linked on the same server? Won't that defeat the purpose of a dev site if the code base is the same as prod?

    How are you handling the environment detection?
    Something like?

    if( $_SERVER['HTTP_HOST'] ) {
    MY DB
    }

  • acktivate
    Avatar
    Community Member
    10 Posts

    Re: 2 sites - config.php database settings ignored - dev/build still loads Link to this post

    I am using symbolic links for the framework files (cms, framework, userforms, etc) The mysite, themes, and mysite/_config.php files are different.

    I resolved this issue by deleting dev.domain.com and rebuilding from scratch.

    264 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.