Whenever you have your TYPO3-system running on several machines, like local, stage and dev, you have to change the settings in your localconf.php, at least in the older versions of TYPO3.
Since TYPO3 6.0 you have to set it in the file AdditionalConfiguration.php, for this one is not being overwritten like LocalConfiguration.php.
Simply check the host you are on and set the db-credentials accordingly:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
// configuration for different servers switch($_SERVER['HTTP_HOST'] ){ case 'stage.host.com': $GLOBALS['TYPO3_CONF_VARS']['DB']['host'] = 'db1.myserver.net'; $GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = 'db1'; $GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'user1'; $GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'pw1'; break; case 'dev.host.local': $GLOBALS['TYPO3_CONF_VARS']['DB']['host'] = 'db1.myserver.net'; $GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = 'db1'; $GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'user1'; $GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'pw1'; break; } |