4951 Posts in 13990 Topics by 1491 members
|Go to End|
11 June 2013 at 3:30am
I've been struggling to install SS for about a day already... It seems that the install wizard doesn't work quite well with _ss_environment.php file. Specifically, the install wizard doesn't seem to recognize the constants "SS_DATABASE_SUFFIX" and "SS_DATABASE_PREFIX".
To elaborate on the issue, assuming my DB is named "ABC_foo_123" and I set SS_DATABASE_PREFIX and SS_DATABASE_SUFFIX with "ABC_" and "_123" respectively therefore leaving "foo" as the database name... if I use "foo" as the DB name, clicking "re-check requirements" button will result to an error stating that the DB doesn't exist. If I enter "ABC_foo_123" as the DB name, clicking "re-check requirements" will result to an "All requirements pass" status. However, if I click "Install Silverstripe", the next page will throw an error stating that "ABC_ABC_foo_123_123" DB does not exist.
Lastly, if I can set the DB host, username, password in _ss_environment.php file, why can't I define the DB name? I wonder what was the design consideration for not allowing the DB name to be defined.
FYI, I have followed this: http://doc.silverstripe.org/framework/en/topics/environment-management
I hope somebody can shed some light on this issue.
Thanks in advance, and kind regards to everybody.
15 June 2013 at 8:34pm
The installer is normally for people who have never set SS up before, whereas people who know to have an _ss_environment usually bypass the installer, suffix / prefix should work so raise it as an issue on github (check 3.1's installer first!)
You can define the DB name in the _ss_environment if you want, nothing to stop you. Infact, this is what we do on a lot of sites as prod name is different to staging. I change my config.php to something like
$database = (defined('SS_DATABASE_NAME')) ? SS_DATABASE_NAME : "ss_sitename";
Then on production I define SS_DATABASE_NAME in the _environment, in other environments I fall back to ss_sitename (dev, uat environments).
|Go to Top|