Hacker News new | ask | show | jobs
by jcstauffer 5574 days ago
Our solution is to store environment-specific config data (such as DB name, username, password, etc.) in the Apache config:

SetEnv DB_USER=kermit SetEnv DB_PASS=Shhh

And then connect to the DB using code such as:

mysql_connect(getenv('DB_NAME'), getenv('DB_USER'), getenv('DB_PASS'))

Environmental config data should never be stored in source code.