Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

2 sites - config.php database settings ignored - dev/build still loads

Go to End

3 Posts   1043 Views


Community Member, 11 Posts

20 October 2013 at 7:16pm

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. and

In the mysite/_config.php,

each site has a unique username, database name and password.
un: prod_db_admin
db name: prod_db
pw: ***
un: dev_db_admin
db name: dev_db
pw: ***

I added 2 new PHP files mysite/code on and I ran dev/build on, 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 and added a page to the CMS and then logged into and the new page appears there as well.

The 2 new PHP files do not exist on mysite/code on 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.



Community Member, 254 Posts

21 October 2013 at 11:57am

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'] ) {


Community Member, 11 Posts

21 October 2013 at 5:34pm

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 and rebuilding from scratch.