News for hackers. Stuff that matters.
Re:How to prevent a leak like Tumblr’s by jcstauffer on Saturday March 19, 2011 @10:44AM (#2343695)
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.

There are no comments on this comment yet.