config files for different servers
Posted: Wed Mar 14, 2007 9:45 pm
Hello all
I have config files containing $host, $dbname, $username and $passwords for different servers: local computer, stagging and production as the following:
config-local.php
$host='localhost';
$dbname='database_local';
.....
config-staging.php
$host='staging_host';
...
config-server.php
....
...
In database.inc.php, I need to include this file for database access. In my local computer, I can have
include('config-local.php');
.....
However, if I want to put this application into the staging server, I have to change this as the following:
include('config-staging.php');
.....
There is better way????- I am using apache server. I can change those values for variables directly at staging or server but I think that is not good way
Any idea
Thanks for any help
sho
I have config files containing $host, $dbname, $username and $passwords for different servers: local computer, stagging and production as the following:
config-local.php
$host='localhost';
$dbname='database_local';
.....
config-staging.php
$host='staging_host';
...
config-server.php
....
...
In database.inc.php, I need to include this file for database access. In my local computer, I can have
include('config-local.php');
.....
However, if I want to put this application into the staging server, I have to change this as the following:
include('config-staging.php');
.....
There is better way????- I am using apache server. I can change those values for variables directly at staging or server but I think that is not good way
Any idea
Thanks for any help
sho